So I have a program that when a person clicks a button, the following happens...
Dim openfile As New OpenFileDialog
openfile.Multiselect = True
openfile.Title = "Add Music Files"
openfile.Filter = "wav files |*.wav"
openfile.FileName = ""
openfile.ShowDialog()
file = System.IO.Path.GetFullPath(openfile.FileName)
filename = System.IO.Path.GetFileName(openfile.FileName)
txtPath.Text = filename
This is all fine. however, when the user clicks Cancel in this section, a runtime error happens because System.IO.Path.GetFullPath(openfile.FileName) = "". What code to I need to put in to stop this from happening?
I know it's preaty simple, I just want to know...