Follow via:
RSS
Email Alert
Question
0 Votes
+ -

New to VB 2005 / relative paths

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?
2nd Nov 2007

Answers (1)

0 Votes
+ -
VB 2005 makes it easy
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
Updated - 10th Nov 2007
Answer the question
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.