Jump to content



Photo

[C#] How to get the Application's name


  • Please log in to reply
3 replies to this topic

#1 $phinX

$phinX

    Neowinian

  • Joined: 13-January 05
  • Location: Hampshire, UK

Posted 21 July 2006 - 15:52

How do i retrieve the application's name?

Isnt it something like App.ApplicationName or something? I cant remember and cant find it on the net!


#2 KayMan2K

KayMan2K

    Terra Atlantis!

  • Joined: 12-June 02

Posted 21 July 2006 - 15:56

Product name of the 'EXE' (not! necessary the name of the 'EXE' file), as seen in Explorer's property window:
Application.ProductName;

Name of the 'EXE' file:
Path.GetFileName(Application.ExecutablePath);


#3 OP $phinX

$phinX

    Neowinian

  • Joined: 13-January 05
  • Location: Hampshire, UK

Posted 21 July 2006 - 16:36

That needs the System.Windows.Forms namespace. Can it be done another way? Im trying to do this inside a class method... not on a windows form.

#4 Stebet

Stebet

    Neowinian

  • Joined: 23-May 03

Posted 21 July 2006 - 16:45

System.AppDomain.CurrentDomain

or

System.Reflection.Assembly.GetExecutingAssembly()

These might help you with what you are trying to do :)