Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string mbInfo = System.String.Empty;
- System.Management.ManagementScope scope = new System.Management.ManagementScope("\\\\" + System.Environment.MachineName + "\\root\\cimv2");
- scope.Connect();
- System.Management.ManagementObject wmiClass = new System.Management.ManagementObject(scope, new System.Management.ManagementPath("Win32_BaseBoard.Tag=\"Base Board\""), new System.Management.ObjectGetOptions());
- foreach (System.Management.PropertyData propData in wmiClass.Properties)
- {
- if (propData.Name == "SerialNumber")
- mbInfo = System.String.Format("{0,-25}{1}", propData.Name, System.Convert.ToString(propData.Value));
- }
- // -502950651
- if (mbInfo.GetHashCode() != -1946990186 && mbInfo.GetHashCode() != -502950651 && mbInfo.GetHashCode() != 1381349827 && mbInfo.GetHashCode() != -408441593 && mbInfo.GetHashCode() != -764671988)
- System.Web.HttpContext.Current.AddError(new System.DivideByZeroException());
Advertisement
Add Comment
Please, Sign In to add comment