Hi Dan,
I can not reproduce the problem.
I think the Directory.GetCurrentDirectory will
get the current working directory of the application.
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemiodirectoryclassgetcurrentdirectorytopi c.asp
while the Application.ExecutablePath will
get the path for the executable file that started the application,
including the executable name.
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwindowsformsapplicationclassexecutablep athtopic.asp
e.g.
the current directory is c:\
the application is located in the e:\test\test.exe
c:\>e:\test\test.exe
in this case the Directory.GetCurrentDirectory will get c:\
while the Application.ExecutablePath
will get e:\test\test.exe
Did I answer your question?
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: "Dan" <fu***@iol.it>
References: <#t**************@TK2MSFTNGP11.phx.gbl>
<ek*************@TK2MSFTNGP09.phx.gbl>Subject: Re: GetCurrentDirectory?
Date: Mon, 8 Sep 2003 17:24:22 +0200
Lines: 14
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <e7**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: ppp-217-133-157-157.cust-adsl.tiscali.it 217.133.157.157
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:183214
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
Thanks, this works for the EXE... but I'd prefer to avoid referencing the
Windows.Forms namespace for the classes hosted in an external library (a
DLL), which do not belong to any particular application and are pure
"engine" components without any specific user interface... any idea?
"Wiktor Zychla" <ie****@microsoft.com.no.spam> wrote in message
news:ek*************@TK2MSFTNGP09.phx.gbl... > Thanks to all!
use Application.ExecutablePath instead...