468,253 Members | 1,284 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,253 developers. It's quick & easy.

how to find current application path using c#

(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.
--------------------------------
From: sathya moorthy

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>8EueDee9RUCXsv7MxKlngw==</Id>
Nov 16 '05 #1
5 61664
Hi Sathya:
"sathya moorthy via .NET 247" <an*******@dotnet247.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
(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.

--------------------------------
From: sathya moorthy

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>8EueDee9RUCXsv7MxKlngw==</Id>


You can use GetExecutingAssembly
http://msdn.microsoft.com/library/de...emblyTopic.asp
..FullName
to get the name and path of the assembly, then you can use the Path Class to
get the path.

HTH,

Bill
Nov 16 '05 #2
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.

On 16/04/2004 sathya moorthy via .NET 247 <an*******@dotnet247.com> wrote:
(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.

--------------------------------
From: sathya moorthy

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>8EueDee9RUCXsv7MxKlngw==</Id>

Nov 16 '05 #3
Try to use Application.ExecutePath, or SetUpPath
good luck!

"sathya moorthy via .NET 247" <an*******@dotnet247.com> wrote in message
news:#5**************@TK2MSFTNGP12.phx.gbl...
(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.

--------------------------------
From: sathya moorthy

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>8EueDee9RUCXsv7MxKlngw==</Id>

Nov 16 '05 #4
Try this, it worked for me...

string AppPath = System.Windows.Forms.Application.StartupPath;
sathya moorthy via .NET 247 wrote:
(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.
--------------------------------
From: sathya moorthy

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>8EueDee9RUCXsv7MxKlngw==</Id>

Nov 16 '05 #5
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" <an*******@dotnet247.com> wrote in message
news:#5**************@TK2MSFTNGP12.phx.gbl...
(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.

--------------------------------
From: sathya moorthy

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>8EueDee9RUCXsv7MxKlngw==</Id>

Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by DJK | last post: by
4 posts views Thread by Asbjørn Ulsberg | last post: by
3 posts views Thread by COHENMARVIN | last post: by
9 posts views Thread by Clinton Frankland | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.