Hi all, I'm not only new to dic but fairly new to VB.
I'm trying to grab a list of files (RTF's in this case) and put them in a list box (I've done this bit).
I get the result like this:
c:\test\test1.rtf
c:\test\test2.rtf
I then need to grab the results (all of them) and turn them into:
c:\test\test1.rtf;c:\test\test2.rtf
so it needs to go on a single line with a semi colon between the results.
I think i need to concatenate the results (?) but i seem to be banging my head a bit. my code for grabbing the files and displaying the results is:
CODE
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
' make a reference to a directory
Dim di As New IO.DirectoryInfo("c:\test")
Dim diar1 As IO.FileInfo() = di.GetFiles("*.rtf")
Dim dra As IO.FileInfo
'list the names of all files in the specified directory
For Each dra In diar1
ListBox1.Items.Add(dra.FullName)
Next
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
End Sub
Any help guys would be really appreciated, I'm not looking for a complete solution cos i like to figure things out (better for learning), but i'm really getting fed up eith this one.
P.S. the reason i need it in the linear fashion is thati'm then using the result to attach to an email so each file needs to have full details and be separated by semi colon.
Robp