Get the application path

  • Thread starter Thread starter cntrl-S
  • Start date Start date
C

cntrl-S

Is there any equivalent of App.Path (VB 6.0) in VB.NET and
C#.
I would like to get the path of my exe at run time. I
tried Forms.Application.ExecutablePath which returns the
full path with application exe name included.
 
Hello,

cntrl-S said:
Is there any equivalent of App.Path (VB 6.0) in VB.NET and
C#.
I would like to get the path of my exe at run time. I
tried Forms.Application.ExecutablePath which returns the
full path with application exe name included.

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

HTH,
Herfried K. Wagner
 
Application.ExecutablePath will return the path that the
program is executing from. It seems to work like the
App.Path from VB6.
 
Back
Top