I would guess something like:
CODEMsgBox("Name: " & fFileSystemInfo.DirectoryName & vbcrlf & "Length: " & fFileSystemInfo.Length & vbcrlf & etc. etc. )
Obviously I haven't checked that, but I think you get the gist of the idea. Though instead of using a message box, perhaps a multi-line textbox would be better? then you could scroll through it afterwards and read it all, copy/paste the info, etc.
If memory serves me, something like:
CODEtextbox1.text = textbox1.text & vbcrlf & "Name: " & fFileSystemInfo.DirectoryName & vbcrlf & "Length: " & fFileSystemInfo.Length & vbcrlf & etc. etc.
That'll append new info to the existing contents of the textbox. Or you could just use TextBox.AppnedText instead (I just remembered that).
In fact...
CODEPrivate Sub SetText([text] As String)
' InvokeRequired compares the thread ID of the
' calling thread to the thread ID of the creating thread.
' If these threads are different, it returns true and fires, Else not.
Try
If Me.txt_folderactivity.InvokeRequired Then
'Dim d As New SetTextCallback(AddressOf SetText)
'Me.Invoke(d, New Object() {[text]})
Me.txt_folderactivity.Invoke(New SetTextCallback(AddressOf SetText), [text])
Else
'Me.txt_folderactivity.Text &= [text]
Me.txt_folderactivity.AppendText([text])
Me.txt_folderactivity.SelectionStart = txt_folderactivity.Text.Length
Me.txt_folderactivity.ScrollToCaret()
End If
Catch ex As Exception
Me.txt_folderactivity.AppendText(ex.Message & vbCrLf)
End Try
End Sub
Private Sub scrollTextDel()
'txt_folderactivity.SelectionLength = 0
txt_folderactivity.SelectionStart = txt_folderactivity.Text.Length
txt_folderactivity.ScrollToCaret()
End Sub
Private Sub scrollText()
myDel = New scrollTextCallback(AddressOf scrollTextDel)
End Sub
I used that a few months back and forgot about it. You'd use it something like: SetText("File " & e.FullPath & " has been created.") and calling ScrollText() would make sure that the newest info was always visible by scrolling the multi-line textbox to the bottom. So I would call that after adding line to the box to keep the newest info visible all the time.
Each time you use SetText it puts whatever info/text on a new line in the textbox. I had to figure this out because I was trying to write to a textbox from another thread and was getting invoke errors about it. SetText gets me around the invoke problem. The program this came from watches a folder on the hard drive, and when files of a certain name or type/extension are created, it starts doing things with them. In my case, it watches for files from my TiVo and converts them to MPG and then moves that new file to a different folder. The textbox was named txt_folderactivity.
Hopefully this'll help or maybe get you on the right track or something. If I wasted your time then I apologize.
____________
Buzzwang
"I can fix it!"
(maybe...)
|
|