472,791 Members | 1,258 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 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 61895
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.