473,473 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

difference between: Path.GetDirectoryName and Directory.GetCurrentDirectory

21 New Member
Hi Guys,

anyone could help me understand the difference between these two methods?

Expand|Select|Wrap|Line Numbers
  1. path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.Replace("file:/", ""));
Expand|Select|Wrap|Line Numbers
  1. path_Startup = System.IO.Directory.GetCurrentDirectory();
I am getting the same result.

I read something about shadow copies and Path.GetDirectoryName being more reliable because of that, but I couldn't find anything too clear.

Anyhelp would be appreciated.

Thanks,
Jan 27 '08 #1
0 1345

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: kk | last post by:
Can any function tell the compiled program executing path? after using the program to open a file from MFC dialog box, the path changes. thks in advance.
2
by: VM | last post by:
How can I retrieve the whole directory where my exe is located? I would've thought Directory.GetCurrentDirectory worked but any event that may change the dir (eg. OpenFileDialog or SaveFileDialog)...
4
by: Tim | last post by:
Hello, i try to write some data into an XML-file via c#. When I specify the path like "c:\\temp\\test.xml" the XmlTextWrite could open the file. But when I tried to get the path from...
5
by: Eranga | last post by:
In c# windows applicatiopns the Application.StartupPath can be used to find the path for the executable file. How can the same be found for a console application?(we can't use application because...
6
by: Willie wjb | last post by:
Hi, i created a windows service. This service is installed in some c:\program files\x directory when started it needs the directory in which it is started. when i use the...
1
by: moondaddy | last post by:
I have a sample vb .net 2.0 winforms app and am using Oneclick deployment to a remote server. All of the files (DLLs, EXEs, manifests, configs, etc.) seem to get deployed to the target folder on...
1
by: Hasan O. | last post by:
Hi , I have a simple program thats open some file a.txt. When program starts it gets GetCurrentDirectory and finds / opens the a.txt file. But if i create a shortcut on desktop it couldnot...
8
by: PvtPile | last post by:
I've got a form where i need to pull both the directory of a filename and the directory with the filename of an .inf file... I figured the easiest way to do this was to have an <input id=test...
2
by: Kakkanattu | last post by:
Hi, In desktop application, we use different ways to get the current execution directory. I. AppDomain.CurrentDomain.BaseDirectory II. Environment.CurrentDirectory...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.