|
-
March 17th, 2003, 08:32 AM
#1
Get current path
How do I get the current path?
-
March 17th, 2003, 12:56 PM
#2
Directory.GetCurrentDirectory() for getting the current working directory or,
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase property if you need the directory where your executable file is stored...
Martin
-
March 17th, 2003, 02:05 PM
#3
adding to martin,
Application.ExecutablePath gives you the executable path.
- Software Architect
-
March 17th, 2003, 05:23 PM
#4
Hi!
Try this:
Assembly assembly = Assembly.GetExecutingAssembly();
string fileName = assembly.Location;
-
March 17th, 2003, 05:30 PM
#5
Assembly assembly = Assembly.GetExecutingAssembly();
string fileName = assembly.Location;
Seems this will return the assembly path. So if your code is in a library, it will be the path of the library, not the path of the calling executive file.
Use Assembly.GetCallingAssembly instead if you want to find the calling executive path.
-
March 17th, 2003, 05:31 PM
#6
I guess originally RYE reffered to application's current path
- Software Architect
-
March 19th, 2003, 08:45 AM
#7
10x a lot.
Yes, I reffered to application's current path, but how can I get it without the exe?
What manipulation on Application.ExecutablePath can I do inorder to get it without the exe in the end?
-
March 19th, 2003, 02:34 PM
#8
the thing is .NET Assembley /DLL is always associated with some .exe either way. you can't run the dll on its own. so you will need to consider exe.
what all you are trying to do anyway
- Software Architect
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|