dreamcatcher

Untitled

Mar 31st, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1.         string mbInfo = System.String.Empty;
  2.         System.Management.ManagementScope scope = new System.Management.ManagementScope("\\\\" + System.Environment.MachineName + "\\root\\cimv2");
  3.         scope.Connect();
  4.         System.Management.ManagementObject wmiClass = new System.Management.ManagementObject(scope, new System.Management.ManagementPath("Win32_BaseBoard.Tag=\"Base Board\""), new System.Management.ObjectGetOptions());
  5.  
  6.         foreach (System.Management.PropertyData propData in wmiClass.Properties)
  7.         {
  8.             if (propData.Name == "SerialNumber")
  9.                 mbInfo = System.String.Format("{0,-25}{1}", propData.Name, System.Convert.ToString(propData.Value));
  10.         }
  11.         // -502950651
  12.         if (mbInfo.GetHashCode() != -1946990186 && mbInfo.GetHashCode() != -502950651 && mbInfo.GetHashCode() != 1381349827 && mbInfo.GetHashCode() != -408441593 && mbInfo.GetHashCode() != -764671988)
  13.             System.Web.HttpContext.Current.AddError(new System.DivideByZeroException());
Advertisement
Add Comment
Please, Sign In to add comment