I have a string called files() and I need to add items to it for a function to work.
I want to use it in another function but it needs to be modified to look like this:
That works but this doesn't:Code:If OpenFileDialog1.ShowDialog = DialogResult.OK Then Dim files() As String = OpenFileDialog1.FileNames ListBox1.Items.Clear() For x As Integer = 0 To files.GetUpperBound(0) filesList.Add(files(x)) Next For x As Integer = 0 To filesList.Count - 1 ListBox1.Items.Add(IO.Path.GetFileName(filesList(x))) Next End If
.luaproj is an extension I've given to directories("projects" to my application)Code:Dim files() As String = FolderBrowserDialog1.SelectedPath + "\" + TextBox3.Text + ".luaproj\" + "index.lua" ListBox1.Items.Clear() For x As Integer = 0 To files.GetUpperBound(0) filesList.Add(files(x)) Next For x As Integer = 0 To filesList.Count - 1 ListBox1.Items.Add(IO.Path.GetFileName(filesList(x))) Next
That code returns the error: "Type 'String' cannot be converted to '1-dimensional array of String'.





Reply With Quote