Hi,
in VB6 i use App.Path to determine the path my executable run from.
what is the VB.NET / framework replacement fot that?
TIA, z.
Shiva - 14 Oct 2004 15:20 GMT
Application.StartupPath
Hi,
in VB6 i use App.Path to determine the path my executable run from.
what is the VB.NET / framework replacement fot that?
TIA, z.
Morten Wennevik - 14 Oct 2004 15:22 GMT
Hi,
Application.StartupPath

Signature
Happy Coding!
Morten Wennevik [C# MVP]
scorpion53061 - 14 Oct 2004 15:23 GMT
Application.StartupPath
> Hi,
>
> in VB6 i use App.Path to determine the path my executable run from.
> what is the VB.NET / framework replacement fot that?
>
> TIA, z.
Imran Koradia - 14 Oct 2004 15:24 GMT
Application.ExecutablePath (with filename) or
Application.StartupPath(without filename). I believe StartupPath directly
corresponds to VB6's App.Path.
hope that helps..
Imran.
> Hi,
>
> in VB6 i use App.Path to determine the path my executable run from.
> what is the VB.NET / framework replacement fot that?
>
> TIA, z.
Herfried K. Wagner [MVP] - 14 Oct 2004 15:45 GMT
"z. f." <zigi@info-scopeREMSPAM.co.il> schrieb:
> in VB6 i use App.Path to determine the path my executable run from.
> what is the VB.NET / framework replacement fot that?
'Application.StartupPath', or more general (can be used in DLL projects
too):
\\\
Imports System.IO
Imports System.Reflection
.
.
.
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

Signature
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/
Cor Ligthert - 14 Oct 2004 16:17 GMT
Herfried,
Nice done really an addition.
Cor
ToddT - 14 Oct 2004 18:28 GMT
are you testing your random word generator application?
>Herfried,
>
>Nice done really an addition.
>
>Cor
scorpion53061 - 14 Oct 2004 18:40 GMT
LOL!
> are you testing your random word generator application?
>
[quoted text clipped - 3 lines]
> >
> >Cor
Cor Ligthert - 14 Oct 2004 19:03 GMT
Yours is better I saw makes much more words
Cor Ligthert - 14 Oct 2004 19:14 GMT
> Herfried,
>
> Nice done really an addition.
Seems that people think this is sarcastic, it is not, we normally see only
the Application.StartupPath I find this a nice addition to that.
Cor
Herfried K. Wagner [MVP] - 14 Oct 2004 20:57 GMT
Cor,
"Cor Ligthert" <notmyfirstname@planet.nl> schrieb:
>> Nice done really an addition.
>>
> Seems that people think this is sarcastic, it is not, we
> normally see only the Application.StartupPath I find this
> a nice addition to that.
:-)

Signature
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/
Stefan Simek - 15 Oct 2004 13:02 GMT
What about AppDomain.CurrentDomain.BasePath?
> "z. f." <zigi@info-scopeREMSPAM.co.il> schrieb:
>> in VB6 i use App.Path to determine the path my executable run from.
[quoted text clipped - 14 lines]
> End Function
> ///
Herfried K. Wagner [MVP] - 15 Oct 2004 14:48 GMT
"Stefan Simek" <simek.blah@kascomp.blah.sk> schrieb:
> What about AppDomain.CurrentDomain.BasePath?
What if you set up more than one appdomain in your application?

Signature
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/
Stefan Simek - 15 Oct 2004 15:42 GMT
> "Stefan Simek" <simek.blah@kascomp.blah.sk> schrieb:
>> What about AppDomain.CurrentDomain.BasePath?
>
> What if you set up more than one appdomain in your application?
If you don't I guess it's usable.
If you do, it depends what exactly do you need to use.
z. f. - 17 Oct 2004 08:07 GMT
if your code is running inside a DLL then code:
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
will not give the same results as
'Application.StartupPath'
since it will return the DLL location while the other will give the
executable location, which i need.
> "z. f." <zigi@info-scopeREMSPAM.co.il> schrieb:
> > in VB6 i use App.Path to determine the path my executable run from.
[quoted text clipped - 14 lines]
> End Function
> ///
Stefan Simek - 18 Oct 2004 07:17 GMT
Then replace GetExecutingAssembly() with GetEntryAssembly() ;)
HTH,
Stefan
> if your code is running inside a DLL then code:
> Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
[quoted text clipped - 21 lines]
>> End Function
>> ///