using System; using SimpleNameAssembly; namespace HostConsole { class Program { static void Main(string[] args) { SimpleName simpleName = new SimpleName(); Console.WriteLine(simpleName.Name); Console.WriteLine(simpleName.Version); Console.WriteLine(simpleName.CodeBase); Console.ReadKey(); } } }
using System; using System.Reflection; namespace SimpleNameAssembly { public class SimpleName { private AssemblyName assemblyName = Assembly.GetExecutingAssembly().GetName(); public string Version { get { return assemblyName.Version.ToString(); } } public string Name { get { return assemblyName.Name; } } public string CodeBase { get { return assemblyName.CodeBase.ToString(); } } } }