How can I get my exe path?

  • Thread starter Thread starter Tony Caduto
  • Start date Start date
T

Tony Caduto

Hi,
In Delphi I could use paramstr(0) to get the full path to my exe during
runtime.
Does anyone know the C# equivilent?

Thanks a bunch,
 
Jay said:
use the following
this.GetType().Assembly.CodeBase

This points to the dir of the current Assembly (if your assembly is NOT the
EXE it will might point to the wrong directory...)
 
Hi,
In Delphi I could use paramstr(0) to get the full path to my exe during
runtime.
Does anyone know the C# equivilent?

Application.ExecutablePath

This also includes the name of the .exe.

Use the static method Path.GetDirectoryname on the Executable string
to exclude the exenam.exe part.

Oz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top