0

I try to make an arraylist which can display all items in one row.

Dim listarray As New ArrayList
Dim JARLIB As String = "*.jar"
Dim dir As New IO.DirectoryInfo(GetFolderPath(SpecialFolder.ApplicationData) & "\.minecraft\libraries\")
Dim diarr1() As IO.FileInfo = dir.GetFiles(JARLIB, SearchOption.AllDirectories)
Dim drar As IO.FileInfo
'list the names of all files in the specified directory
For Each drar In diarr1
    listarray.Add((drar.DirectoryName) & ";")
Next
elemante = listarray.ToString
RichTextBox1.Text = elemante

And that is not working, i must recive in TextBox something like

C:\User\file.jar;C:\User\file\file2.jar;

Can you help me ? Thanks !

1
  • I guess that you meant drar.Name or drar.FullName rather than drar.DirectoryName Commented Jul 10, 2013 at 8:21

1 Answer 1

1

listarray.ToString won't return you all the elements of the ArrayList.

It seems you want something like this:

Dim listarray As New ArrayList
Dim JARLIB As String = "*.jar"
Dim dir As New IO.DirectoryInfo(GetFolderPath(SpecialFolder.ApplicationData) & "\.minecraft\libraries\")
Dim diarr1() As IO.FileInfo = dir.GetFiles(JARLIB, SearchOption.AllDirectories)
Dim drar As IO.FileInfo
'list the names of all files in the specified directory
For Each drar In diarr1
    listarray.Add((drar.DirectoryName) & ";")
Next
For Each item In listarray
    elemante = elemante & item.ToString
Next
RichTextBox1.Text = elemante
Sign up to request clarification or add additional context in comments.

2 Comments

is ok but now C:\Users\lwjgl_util\2.9.0 and file.jar is not appear
See a comment to your question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.