, " ".
Application.ExecutablePath , , , , - , .
Assembly.GetEntryAssembly().GetName().Name . , , ,
, GetName(). .
, . , ExecutablePath , GetName(), GetName() Reflection, .
EDIT:
Try to create this console application, run it, and then try to rename the executable file name using Windows File Explorer, run it again by double-clicking on the renamed executable file. ExecutablePath reflects the change, the assembly name is the same as
using System;
using System.Reflection;
using System.Windows.Forms;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Assembly.GetEntryAssembly().GetName().Name);
Console.WriteLine(Application.ExecutablePath);
Console.ReadLine();
}
}
}
Steve source
share