The path is not of a legal form. Getting Dir from Registry.
Anyone have some ideas as to what I'm doing wrong here.
I get this error:
An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: The path is not of a legal form.
When I retrieve the dir from the registry. I marked the offending line below with '****************************
Code:
Private Sub btnNesRom_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNesRom.Click
'Opens Directory Selecter. Reference to DirectorySelect.dll
Dim NesDirSelect As New DirectorySelect.frmDirectoryBrowse()
'Title of NesDirSelect
NesDirSelect.Title = "Select Rom Directory"
'Default Starting point is C:\
NesDirSelect.StartingDirectory = "C:\"
'Show as dialog
NesDirSelect.ShowDialog(Me)
If NesDirSelect.Filename <> "" Then
SaveSetting("Multi-Front", "NesRoms", "RomsPath", NesDirSelect.Filename)
Dim FillRomsList() As String
Dim Roms As Integer
'*************************************************
FillRomsList = System.IO.Directory.GetFileSystemEntries(GetSetting("Multi-Font", "NesRoms", "RomsPath"))
'*************************************************
lstRomsNes.Items.Clear()
For Roms = 0 To FillRomsList.Length - 1
lstRomsNes.Items.Add(FillRomsList(Roms))
Next
Me.Text = lstRomsNes.Items.Count
'txtPath.Text = DirectoryBrowse.Filename
End If
'This IF structure checks the filename returned
'if the filename contains text, it will replace the label text
'otherwise, the label will keep its original text
NesDirSelect.Dispose()
'Free up resources used by component
End Sub