I am working on my HWID code. I recently tried converting this code from VB.net to C#. I have this one error which I can't seem to figure out.
'dsk' is a 'variable' but is used as a 'method'
Here is my code
string returnString = null;
string systemDisk = Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Machine);
if (systemDisk != null)
{
ManagementObject dsk = new ManagementObject("Win32_LogicalDisk.DeviceID=\"" + systemDisk.Substring(0, 2) + "\"");
dsk.Get();
returnString = dsk("VolumeSerialNumber");
}
return returnString;