KingTomato
New member
- Joined
- Sep 17, 2007
- Messages
- 1
- Programming Experience
- 3-5
Hello, I am working on a program that allows a user to specify path(s) to monitor for file activity. Below is my code to get the drives and list them in a ListViewBox. I am needing help with creating a new FileSystemWatcher for each drive in the ListViewBox, then for each drive the user has checked it specifies it to the watcher. If you don't understand let me know and I'll try to explain it better. Thanks in advance.
This code gets the drives on teh computer. I would like to make it where they cant check the items with Cannot Access Drive. Any ideas?
VB.NET:
Sub ShowDrives()
Dim alldrives() As DriveInfo = DriveInfo.GetDrives
Dim d As DriveInfo
Dim newlst As ListViewItem
Dim drives As String()
drives = System.IO.Directory.GetLogicalDrives()
For Each d In alldrives
newlst = fm_drives.Items.Add(0)
newlst.SubItems.Add(1)
If d.IsReady = True Then
newlst.Text = (d.Name)
End If
If d.IsReady = False Then
newlst.Text = d.Name & " - Cannot Access Drive"
End If
Next
End Sub
This code gets the drives on teh computer. I would like to make it where they cant check the items with Cannot Access Drive. Any ideas?