how to get startupPath in console application

  • Thread starter Thread starter Ron
  • Start date Start date
R

Ron

Hello,

I would like to retrieve the startupPath from a console
application. It appears that a console application does
not recognize Application, so I can't access StartupPath.
Is there a way to do this in a console application?

Thanks,
Ron
 
Ron said:
I would like to retrieve the startupPath from a console
application. It appears that a console application does
not recognize Application, so I can't access StartupPath.
Is there a way to do this in a console application?

\\\
Imports System.Reflection
..
..
..
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetEntryAssembly().Location)
End Function
///
 
Thanks. That was what I needed.
Ron
-----Original Message-----
Ron said:
I would like to retrieve the startupPath from a console
application. It appears that a console application does
not recognize Application, so I can't access StartupPath.
Is there a way to do this in a console application?

\\\
Imports System.Reflection
..
..
..
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetEntryAssembly ().Location)
End Function
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
.
 
Back
Top