user319854
user319854

Reputation: 4126

get disk manufacturer using WMI

how get USB flash(key) manufacturer name with C#?

for example WD, Hama, Kingston...

Now i with: "disk["Manufacturer"]", get: "Standard disk driver"

string drive = "h";
ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID=\"" + drive + ":\"");
disk.Get();

Console.WriteLine(disk["VolumeSerialNumber"].ToString());
Console.WriteLine(disk["VolumeName"].ToString());
Console.WriteLine(disk["Manufacturer"].ToString());

Upvotes: 1

Views: 4238

Answers (1)

Jack B Nimble
Jack B Nimble

Reputation: 5087

Use Win32_DiskDrive. Model may or may not include the name of the manufacturer, but with the model number (or serial number) you can extrapolate the manufacturer.

Also see this CodeProject which demonstrates use.

Upvotes: 1

Related Questions