"Barry Flynn" <Anonymouse> wrote in message
news:%23Fr3HL8ZKHA.4932@newsgroup
> Win Forms program - VB 2005.
>
> I am converting a VB6 program to VB 2005.
> The program wants to know its own name - ie the name of the .exe that has
> been executed.
> It gets this from App.exename
>
> In VB 2005, I have replaced this with My.Application.Info.AssemblyName.
> However, if the program has been renamed after it was Built, that returns
> the name it was Built as, rather than the name of the .exe that has
> actually been executed.
>
> Is the name of the actual .exe available?
>
> Thanks
>
> Barry Will this work?
[C#]
System.Diagnostics.Process p =
System.Diagnostics.Process.GetCurrentProcess();
String n = p.ProcessName;
-Scott