473,856 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

difference between: Path.GetDirecto ryName and Directory.GetCu rrentDirectory

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.GetDirecto ryName being more reliable because of that, but I couldn't find anything too clear.

Anyhelp would be appreciated.

Thanks,
Jan 27 '08 #1
0 1367

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

Similar topics

11
15321
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
1869
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) will change the current directory. Thanks.
4
4217
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 Directory.GetCurrentDirectory() and combine it with my file, the XmlTextWriter couldn't open the file. The returned path from Directory.Get... contains only one \. Is this the problem?
5
62702
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 it inherits from the System.Windows.Forms namespace) Thanks in advance. *** Sent via Developersdex http://www.developersdex.com ***
6
9991
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 system.environment.currentdirectory i get the C:\WINNT\SYSTEM32 in stead of the c:\program files\x.
1
2742
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 the client OK and seem to work OK, Except for some additional files I created for the client application. For example, I have a file called myData.xml and myCustomConfix.xml which the windows app uses. In the old 1.1 days (while working in the...
1
1711
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 find real working directory. How can i do this ? this is not working for shortcuts char buf; GetCurrentDirectory(2000, buf);
8
2826
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 type=file runat=server> control for the user to find the .inf file, and then make vb cut off the filename upon submission of the form. I just can't figure out how to trim off the filename leaving just the directory it's located in. just as a test...
2
2629
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 III. Directory.GetCurrentDirectory() IV. Assembly.GetExecutingAssembly().Location Can u please help me to know the difference of all these? Also is there any other way to get the current directory other than the above?
0
9916
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10782
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10384
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9531
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7932
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5761
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4575
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 we have to send another system
2
4174
muto222
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.