VisualBasic FileBrowse Dialog

34 views Asked by At

Okay, so I'm making a program where you have two radio boxes to choose from, for the time being, lets call them rb1 and rb2. And so, Which ever one you choose, you press the launch button (BtnLaunch) and the program will launch depending on which radiobox you chose.

The problem I am having is that it only works on my computer as my file path for these programs are in my Z:\ Hard Drive where as most people have C:\ or E:. So I'd like it if the user could choose the file path for rb1 and rb2 and so the next time they open the program, it saves so that they don't need to write the path for the file location again.

So if you dont understand here is my code for radiobuttons:

    Private Sub BtnLaunch_Click(sender As Object, e As EventArgs) Handles BtnLaunch.Click
    If BtnServer1.Checked = True Then Process.Start("Z:\Path\Program1")
    If BtnServer2.Checked = True Then Process.Start("Z:\Path\Program2")

End Sub

So I would like to replace the path with the users choice of path as some people will have ("C:\OtherFolderName\Program") and other will have different. I really hope you understand. Please be broad in answers as I'm new to VB.

Thank you.

1

There are 1 answers

0
Lance On

You can either save an ini file that your program could write to when the user changes the selection, the reads when ever it's launched. Or you could write the path to the registry and read it back on launch.

Same thing, two different ways.