Click here to Skip to main content
15,878,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have purchased SoftDog security dongle for my application now i want to detect its unique id. how can i can i get this. my device do not expose in window drives.

i used WMI but not working


ManagementObjectSearcher theSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive WHERE InterfaceType='USB'");
            foreach (ManagementObject currentObject in theSearcher.Get())
            {
                string id = currentObject["PNPDeviceID"].ToString();
                string[] ids = id.Split('\\');
                idA = ids[ids.Length - 1];
                //idA = label1.Text;
                // textBox1.Text += idA + "\r\n";
                break;
                //label1.Text += currentObject["PNPDeviceID"].ToString() + "\r\n";
                //ManagementObject theSerialNumberObjectQuery = new ManagementObject("Win32_PhysicalMedia.Tag='" + currentObject["PNPDeviceID"] + "'");
                //MessageBox.Show(theSerialNumberObjectQuery["SerialNumber"].ToString());
            }

its SDK includes complex procedure..
but not getting iD of my device.
Posted
Updated 29-Nov-11 22:47pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900