how to find current application path using c#

  • Thread starter Thread starter sathya moorthy via .NET 247
  • Start date Start date
S

sathya moorthy via .NET 247

(Type your message here)
hi. i am doing a small application project in c#. can any one help me how to find the directory of the current running program. how to create the input box in c# program.
 
Try to use Application.ExecutePath, or SetUpPath
good luck!

sathya moorthy via .NET 247 said:
(Type your message here)
hi. i am doing a small application project in c#. can any one help me how
to find the directory of the current running program. how to create the
input box in c# program.
 
current running program? as in thee executable? If so to get the directory
you'd use Application.StartupPath. To get the executable path you'd use
Application.ExecutablePath.

(Type your message here)
hi. i am doing a small application project in c#. can any one help me how to
find the directory of the current running program. how to create the input box
in c# program.
 
Try this, it worked for me...

string AppPath = System.Windows.Forms.Application.StartupPath;
 
try this:

String currentProgram = System.Environment.CommandLine;

that would give u the fullpath of your current executable.

hope that helps,

Du

sathya moorthy via .NET 247 said:
(Type your message here)
hi. i am doing a small application project in c#. can any one help me how
to find the directory of the current running program. how to create the
input box in c# program.
 
Back
Top