.. as this seems to
pick up the Hard Drive serial number using windows API's.
Here's the mini class I have for the MachineInfo that I used. It may be useful to you at some point:
using System;
using System.Management;
namespace MachineInfo
{
public class GetInfo
{
ManagementObject disk = null;
public GetInfo(string strDriveLetter)
{
if (strDriveLetter == "" || strDriveLetter == null) strDriveLetter = "C";
disk = new ManagementObject("win32_logicaldisk.deviceid=\"" + strDriveLetter + ":\"");
disk.Get();
}
public string GetPropertyValue(string propertyName)
{
try
{
return disk[propertyName] == null ? String.Empty : propertyName + ": " + disk[propertyName].ToString();
}
catch (ManagementException)
{
return String.Empty;
}
}
public string GetPropertyNameList()
{
string s = String.Empty;
foreach (PropertyData d in disk.Properties)
{
s += d.Name + ",";
}
return s;
}
}
}
protected void GetMachineInfo_Click(object sender, EventArgs e)
{
GetInfo qa = new GetInfo("c");
string[] a = qa.GetPropertyNameList().Split(',');
for (int i = 0; i<a.Length; i++)
{
ListBox1.Items.Add(qa.GetPropertyValue(a[i]));
}
}