app.path; what is the VB .NET equivilant?

  • Thread starter Thread starter Roy Lawson
  • Start date Start date
R

Roy Lawson

I have been working with .NET for a few months now and currently
working on the certs. In preparation for certification I am making an
application that demonstrates a bunch of .NET different concepts...but
am trying to make a simple connection to an Access file in the
application directory. I can connect directly to the file, but when I
package the application in the Windows Installer it will move to
another folder when installed. What is a technique to prevent the
path from breaking? In VB6 I just used app.path and would return that
value to a string(strPath). My database directory would be something
like strPath & "/data". How would I do that now?
 
Hello,

Roy Lawson said:
In VB6 I just used app.path and would return that
value to a string(strPath). My database directory would
be something like strPath & "/data". How would I do that now?

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