By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,581 Members | 1,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,581 IT Pros & Developers. It's quick & easy.

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

P: n/a
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?
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hello,

"Roy Lawson" <ro*@xeon.tv> schrieb:
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
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.