473,322 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Array using Filesystemwatcher don't run

I wrote this code, but it don't work:

Expand|Select|Wrap|Line Numbers
  1. Dim i As Integer = 0
  2. Dim drives() As String
  3. drives = GetListofDrives()
  4. or Each sdrives In drives
  5. i += 1
  6. Next
  7. Dim a(i) As FileSystemWatcher
  8. i = 0
  9. For Each drive As IO.DriveInfo In IO.DriveInfo.GetDrives
  10. Dim itemText As String = drive.Name
  11. Dim ltr As String = drive.Name
  12. Dim Type As String
  13. If drive.IsReady AndAlso drive.VolumeLabel <> "" Then
  14. itemText = drive.VolumeLabel
  15. Else
  16. Select Case drive.DriveType
  17. Case IO.DriveType.Fixed : itemText = "Local Disk"
  18. Case IO.DriveType.CDRom : itemText = "CD-ROM"
  19. Case IO.DriveType.Network : itemText = "Network Drive"
  20. Case IO.DriveType.Removable : itemText = "Removable Disk"
  21. Case IO.DriveType.Unknown : itemText = "Unknown"
  22. End Select
  23. End If
  24. Select Case drive.DriveType
  25. Case IO.DriveType.Fixed : Type = "Local Disk"
  26. Case IO.DriveType.CDRom : Type = "CD-ROM"
  27. Case IO.DriveType.Network : Type = "Network Drive"
  28. Case IO.DriveType.Removable : Type = "Removable Disk"
  29. Case IO.DriveType.Unknown : Type = "Unknown"
  30. End Select
  31. If Type = "CD-ROM" Then
  32. Else
  33. a(i) = New FileSystemWatcher
  34. a(i).Path = ltr
  35. AddHandler a(i).Changed, AddressOf scan
  36. a(i).EnableRaisingEvents = True
  37. i += 1
  38. End If
  39. Next
Feb 17 '13 #1
1 1279
Rabbit
12,516 Expert Mod 8TB
Please define what doesn't work means. Are you getting error codes? What are they? Are you seeing undefined behavior? What is it? What is the correct behavior?
Feb 17 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Josh Usovsky | last post by:
I'm setting up a watched folder using FileSystemWatcher. When I drop a small file into the watched folder, I can respond to a .Created event and process the file with other code. However, if I try...
11
by: Sontu | last post by:
Consider the following code: int main(void) { char buffer; func(buffer); } void func(char *bufpas) {
31
by: arun | last post by:
suppose i have a pointer to an array of integers.can i initialize each member of the array using pointers?plz explain
5
by: Krish | last post by:
Hello People I hope I am On Topic. Anyways, here is my problem. Any insights would be really appreciated. I have wrapped a C IO module using SWIG -> Python Module. Suppose the name of the...
8
by: Skay | last post by:
Someone challenged me to create a dynamic multidimensional array using auto_ptr http://www.gotw.ca/gotw/042.htm Provides a good way to create a single dimensional array using an adapter. ...
1
by: geervani | last post by:
hello, Can anybody just tell me how to scan or input a 2d array using pointer i e indirect reference. I am allocating memory the array dynamically. the statement i am using is int *a;...
4
by: boss1 | last post by:
hellow everyone, i m a new php web developer. i got a problem. i m using innerHtml and html Dom to retrieve some data from oracle database and view on to html page.But i dont know how to insert...
3
by: SM | last post by:
Hello, I have an array that holds images path of cd covers. The array looks like this: $cd = array( 589=>'sylver.jpg', 782=>'bigone.jpg', 158=>'dime.jpg' );
8
by: anandmms | last post by:
Hello friend, my problem is to save more than one fingerprint images in one byte array and then store in database(oracle). i dont know how to solve it. But previously i had did image saving...
9
Maidenz08
by: Maidenz08 | last post by:
Hi, I am developing a monitoring tool which logs all the files that are being uploaded. I am using FileSystemWatcher class to achive this. When a file is selected for upload the Changed event of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.