Get current Directory

  • Thread starter Thread starter Matthew
  • Start date Start date
M

Matthew

I am wanting to find the directory my program is installed in and use this
in my code. Is there a fast, easy way to do this?

Matthew
 
Hi Matthew,

I am wanting to find the directory my program is installed in and use this
in my code. Is there a fast, easy way to do this?

Imports System.Reflection

System.IO.Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)

Cheers

Arne Janning
 
Matthew said:
I am wanting to find the directory my program is installed in
and use this in my code. Is there a fast, easy way to do this?

'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
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top