AwAk3e
October 18th, 2009, 12:38 PM
Hello, I have just started to learn C# and come from a type-safe language, AutoIt. So I'm just coming to terms with classes etc and I was trying to achieve a function in AutoIt known as DriveGetSerial(path) which will allow me to get the serial of a USB Storage device.
So after googling about I found this;
http://downloads.cfdan.com/csharp/usbserialnumber.cs.txt
However it gives me six errors, all about the System.Management.
The errors are:
1. The type or namespace name 'ManagementObject' could not be found (are you missing a using directive or an assembly reference?)
2. The type or namespace name 'ManagementObject' could not be found (are you missing a using directive or an assembly reference?)
3. The type or namespace name 'ManagementObjectSearcher' could not be found (are you missing a using directive or an assembly reference?)
4. The type or namespace name 'ManagementObjectSearcher' could not be found (are you missing a using directive or an assembly reference?)
5. The type or namespace name 'ManagementObjectSearcher' could not be found (are you missing a using directive or an assembly reference?)
6. The type or namespace name 'ManagementObjectSearcher' could not be found (are you missing a using directive or an assembly reference?)
However as seen in the class file I have added, 'Using System.Management' and yet it yields errors so in hope of a solution I have came to these forums.
Does anyone know why this is happening? Thanks in advance, AwAk3e.
So after googling about I found this;
http://downloads.cfdan.com/csharp/usbserialnumber.cs.txt
However it gives me six errors, all about the System.Management.
The errors are:
1. The type or namespace name 'ManagementObject' could not be found (are you missing a using directive or an assembly reference?)
2. The type or namespace name 'ManagementObject' could not be found (are you missing a using directive or an assembly reference?)
3. The type or namespace name 'ManagementObjectSearcher' could not be found (are you missing a using directive or an assembly reference?)
4. The type or namespace name 'ManagementObjectSearcher' could not be found (are you missing a using directive or an assembly reference?)
5. The type or namespace name 'ManagementObjectSearcher' could not be found (are you missing a using directive or an assembly reference?)
6. The type or namespace name 'ManagementObjectSearcher' could not be found (are you missing a using directive or an assembly reference?)
However as seen in the class file I have added, 'Using System.Management' and yet it yields errors so in hope of a solution I have came to these forums.
Does anyone know why this is happening? Thanks in advance, AwAk3e.