How to get Operating System serial number
ManagementObjectSearcher objMOS;
ManagementObjectCollection objMOC;
objMOS = new ManagementObjectSearcher("Select * From Win32_OperatingSystem");
objMOC = objMOS.Get();
foreach (ManagementObject objMO in objMOC)
{
string SerialNumber= Convert.ToString(objMO["SerialNumber"]);
}
objMOS.Dispose();
objMOS = null;
ManagementObjectCollection objMOC;
objMOS = new ManagementObjectSearcher("Select * From Win32_OperatingSystem");
objMOC = objMOS.Get();
foreach (ManagementObject objMO in objMOC)
{
string SerialNumber= Convert.ToString(objMO["SerialNumber"]);
}
objMOS.Dispose();
objMOS = null;
0 comments: