Questions

New to VB 2005 / relative paths

Tags:
+
0 Votes
Locked

New to VB 2005 / relative paths

pizzathahut
Hi ya'll! 1st question here.
I've been out of programming for a few years now and am currently attempting to refresh myself and tackle the whole .Net bs due to work, they work in C# so I'm tackling VB2005 1st ( I have my VB6) to get my memory refreshed then will tackle C#.

So I've been playing around with the basics, load txt files, populate lsts at runtime and via files ect ect. so I have some of the new VB syntax covered so far.

I have my app running fine, problem I encountered though is when I go to build it, like make the install file ect, my program is not portable as I all files are listed explicitly and I'm having issues with using relative paths.

Now I figured this would be easy to overcome over a little googling, but alas, .Net is pissing me off. Almost so I considered going back to VB6 just to get my project done.

No I really miss the easy VB6 way of doing things. there has to be some simple way to buil dmy project with an intended install path with all sub dirs included in the install.

Can anyone point me in the right direction?
  • +
    0 Votes
    Bob G Beechey

    You simply identify the current directory of your app. For example:
    Dim MyAppDir As String = Environment.CurrentDirectory
    Then you can append this with subdirectory name at leisure.
    For example:
    Dim MySubName As String = "DataFiles"
    Dim MyFullName As String = MyAppDir & "\" & MySubName
    Hope this helps. The Environment class is very useful in VB2005
    Bob

  • +
    0 Votes
    Bob G Beechey

    You simply identify the current directory of your app. For example:
    Dim MyAppDir As String = Environment.CurrentDirectory
    Then you can append this with subdirectory name at leisure.
    For example:
    Dim MySubName As String = "DataFiles"
    Dim MyFullName As String = MyAppDir & "\" & MySubName
    Hope this helps. The Environment class is very useful in VB2005
    Bob