473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 61922
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matthias Ludwig | last post by:
I'm trying to create a directory on the web server with a vb.net code: .... Dim dirName As String = "w:\filepath\images" If Not Directory.Exists(dirName) Then...
0
by: DJK | last post by:
I have a VB.NET Web Forms Application that used to work on Windows Server 2000. After an upgrade to 2003 the application fails with a Could not find a part of the path error message when setting...
4
by: Asbjørn Ulsberg | last post by:
I just wonder if it's a simpler way to get the path to the current user's temporary folder than this: string path = Path.GetFullPath(Path.Combine(Environment.GetFolderPath(...
3
by: COHENMARVIN | last post by:
I put the following code in my asp.net page: dbPath = MapPath("/FBDB/db1_newport2003.mdb") strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" strConnect = strConnect & "Data Source=" & dbpath & ";"...
9
by: Clinton Frankland | last post by:
Hi, On a Windows 2000 Server when attempting to use System.IO.Directory.CreateDirectory(string.concat(Server.MapPath(""), "\verify")) I receive a System.IO.DirectoryNotFoundException error:...
1
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the...
1
by: Simon | last post by:
Dear Access friends, How can I load a string with his own folder address. The following code addressed to the system folder of MS programs.
1
by: mathieu | last post by:
Hi, This is slightly off-topic (not purely C++). But I was wondering how do people handle ressources (input file) in their C++ applications in a cross platform way ? I tought first of using...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.