Пример #1
0
        // Token: 0x06000030 RID: 48 RVA: 0x00002C24 File Offset: 0x00000E24
        private string GetMACAddress(string Adapter)
        {
            ManagementObjectCollection instances = new ManagementClass("Win32_NetworkAdapterConfiguration").GetInstances();
            string result;

            try
            {
                ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    ManagementObject managementObject = (ManagementObject)enumerator.Current;
                    if (Operators.ConditionalCompareObjectEqual(managementObject["IPEnabled"], true, false) && Operators.CompareString(managementObject["Caption"].ToString().Substring(11), Adapter, false) == 0)
                    {
                        result = managementObject["MacAddress"].ToString();
                        break;
                    }
                }
            }
            finally
            {
                ManagementObjectCollection.ManagementObjectEnumerator enumerator;
                if (enumerator != null)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
            return(result);
        }
Пример #2
0
        // Token: 0x0600002E RID: 46 RVA: 0x00002B80 File Offset: 0x00000D80
        private void FillNetworkAdapters()
        {
            ManagementObjectCollection instances = new ManagementClass("Win32_NetworkAdapterConfiguration").GetInstances();

            try
            {
                ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    ManagementObject managementObject = (ManagementObject)enumerator.Current;
                    if (Operators.ConditionalCompareObjectEqual(managementObject["IPEnabled"], true, false))
                    {
                        string item = managementObject["Caption"].ToString().Substring(11);
                        this.combo_network.Items.Add(item);
                    }
                }
            }
            finally
            {
                ManagementObjectCollection.ManagementObjectEnumerator enumerator;
                if (enumerator != null)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
        }
Пример #3
0
        public static string GetMotherBoardID()
        {
            ManagementObjectCollection mbCol = new ManagementClass("Win32_BaseBoard").GetInstances();

            //Enumerating the list
            ManagementObjectCollection.ManagementObjectEnumerator mbEnum = mbCol.GetEnumerator();
            //Move the cursor to the first element of the list (and most probably the only one)
            mbEnum.MoveNext();
            //Getting the serial number of that specific motherboard
            return(((ManagementObject)(mbEnum.Current)).Properties["SerialNumber"].Value.ToString());
        }
Пример #4
0
 /*Get MotherBoardId */
 public static string GetMotherBoardID()
 {
     try
     {
         ////ManagementObjectCollection mbCol = new ManagementClass("Win32_BaseBoard").GetInstances();
         ManagementObjectCollection mbCol = new ManagementClass("Win32_BIOS").GetInstances();
         //Enumerating the list
         ManagementObjectCollection.ManagementObjectEnumerator mbEnum = mbCol.GetEnumerator();
         //Move the cursor to the first element of the list (and most probably the only one)
         mbEnum.MoveNext();
         //Getting the serial number of that specific motherboard
         return(((ManagementObject)(mbEnum.Current)).Properties["SerialNumber"].Value.ToString());
     }
     catch (Exception ex)
     {
         GlobalSysFunctions.ShowCallerInfo("GlobalSysInfo => GetMotherBoardID : ", ex);
         throw new BLException("GlobalSysInfo => GetMotherBoardID : " + ex.Message);
     }
 }
Пример #5
0
 private static string smethod_0()
 {
     try
     {
         ManagementObjectCollection instances = new ManagementClass("Win32_Processor").GetInstances();
         string str = null;
         using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator())
         {
             if (enumerator.MoveNext())
             {
                 ManagementObject obj2 = (ManagementObject)enumerator.Current;
                 str = obj2.Properties[("ProcessorId")].Value.ToString();
             }
         }
         return(str);
     }
     catch
     {
         return("");
     }
 }
Пример #6
0
        // Token: 0x060000EE RID: 238 RVA: 0x00006408 File Offset: 0x00004608
        private static string ProcessorId()
        {
            string result;

            try
            {
                ManagementObjectCollection instances = new ManagementClass("win32_processor").GetInstances();
                string text = string.Empty;
                using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator())
                {
                    if (enumerator.MoveNext())
                    {
                        text = enumerator.Current.Properties["processorID"].Value.ToString();
                    }
                }
                result = text;
            }
            catch
            {
                result = "-WRONGID-" + Helper.GetRandomString();
            }
            return(result);
        }
Пример #7
0
        private static string GetCpuId()
        {
            //传入"Win32_Processor"可获得CPU处理器信息
            ManagementObjectCollection instances = new ManagementClass("Win32_Processor").GetInstances();

            string str = (string)null;

            //
            using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    str = enumerator.Current.Properties["ProcessorId"].Value.ToString();
                }
            }
            return(str);
        }
Пример #8
0
 public string GetCpuID()
 {
     try
     {
         ManagementObjectCollection instances = new ManagementClass("Win32_Processor").GetInstances();
         string str = (string)null;
         using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator())
         {
             if (enumerator.MoveNext())
             {
                 str = enumerator.Current.Properties["ProcessorId"].Value.ToString();
             }
         }
         return(str);
     }
     catch
     {
         return("");
     }
 }
        public string GetCpuID()
        {
            try
            {
                ManagementObjectCollection instances = new ManagementClass("Win32_Processor").GetInstances();
                string str = null;
                ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator();
                try
                {
                    int num = 3;
Label_002B:
                    switch (num)
                    {
                    case 0:
                        if (enumerator.MoveNext())
                        {
                            break;
                        }
                        num = 1;
                        goto Label_002B;

                    case 1:
                    case 4:
                        num = 2;
                        goto Label_002B;

                    case 2:
                        goto Label_00F5;

                    default:
                        num = 0;
                        goto Label_002B;
                    }
                    ManagementObject current = (ManagementObject)enumerator.Current;
                    str = current.Properties["ProcessorId"].Value.ToString();
                    num = 4;
                    goto Label_002B;
                }
                finally
                {
                    int num2 = 2;
Label_00BA:
                    switch (num2)
                    {
                    case 0:
                        enumerator.Dispose();
                        num2 = 1;
                        goto Label_00BA;

                    case 1:
                        break;

                    default:
                        if (enumerator != null)
                        {
                            num2 = 0;
                            goto Label_00BA;
                        }
                        break;
                    }
                }
Label_00F5:
                return(str);
            }
            catch
            {
                return("");
            }
        }
Пример #10
0
        // Token: 0x060000EB RID: 235 RVA: 0x0000B294 File Offset: 0x00009494
        private static string GetProcessor()
        {
            ManagementObjectCollection instances = new ManagementClass("win32_processor").GetInstances();
            string text  = string.Empty;
            string text2 = string.Empty;
            string text3 = string.Empty;
            string text4 = string.Empty;

            using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    text  = enumerator.Current.Properties["processorID"].Value.ToString();
                    text2 = enumerator.Current.Properties["Name"].Value.ToString();
                    text3 = enumerator.Current.Properties["NumberOfCores"].Value.ToString();
                    text4 = enumerator.Current.Properties["Manufacturer"].Value.ToString();
                }
            }
            return(string.Concat(new string[]
            {
                "Name - ",
                text2,
                ", id - ",
                text,
                ", kerls - ",
                text3,
                ", manufacturer - ",
                text4
            }));
        }
Пример #11
0
 public static bool CHECK_HWID()
 {
     try
     {
         WebBrowser webBrowser = new WebBrowser();
         Computer   computer   = new Computer();
         WebClient  webClient  = new WebClient();
         ManagementObjectCollection instances = new ManagementClass("win32_processor").GetInstances();
         string empty = string.Empty;
         using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator())
         {
             if (enumerator.MoveNext())
             {
                 empty = enumerator.Current.Properties["DeviceID"].Value.ToString();
             }
         }
         ManagementObject managementObject = new ManagementObject("win32_logicaldisk.deviceid=\"c:\"");
         managementObject.Get();
         string[] strArray = new string[11];
         strArray[0] = empty;
         strArray[1] = managementObject["Size"].ToString();
         strArray[2] = computer.Info.TotalPhysicalMemory.ToString();
         strArray[3] = computer.Info.OSFullName;
         strArray[4] = computer.Screen.DeviceName;
         Rectangle bounds = computer.Screen.Bounds;
         int       num    = bounds.Height;
         strArray[5]  = num.ToString();
         bounds       = computer.Screen.Bounds;
         num          = bounds.Width;
         strArray[6]  = num.ToString();
         strArray[7]  = HWID.PrimaryBusType;
         strArray[8]  = HWID.Product;
         strArray[9]  = HWID.RevisionNumber;
         strArray[10] = HWID.Removable.ToString();
         byte[] bytes  = Encoding.UTF8.GetBytes(string.Concat(strArray));
         string source = "\x0097££\x009F¢i^^\x0092\x0097\x0094\x0092\x009A\x0097\x0094\x0092\x009A\x0095\x009E¡¨\x009E¤]___¦\x0094\x0091\x0097\x009E¢£\x0090\x009F\x009F]\x0092\x009E\x009C^wxsb]\x009F\x0097\x009Fn\x0098\x0093l";
         HWID.HardWareID = Convert.ToBase64String(bytes);
         HWID.Parts      = webClient.DownloadString(HWID.stronk(source, (short)-47) + HWID.HardWareID).Split('|');
         webBrowser.ScriptErrorsSuppressed = true;
         webBrowser.Navigate("https://time.is/Unix_time_now");
         for (int index = 0; index <= 99; ++index)
         {
             if (!webBrowser.DocumentText.Contains("clock0"))
             {
                 Application.DoEvents();
                 index = 0;
             }
         }
         long totalSeconds = (long)(int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
         HWID.Expiretime = Convert.ToInt64(HWID.Parts[3]);
         HWID.timeleft   = HWID.Expiretime - totalSeconds;
         foreach (string part in HWID.Parts)
         {
             ;
         }
         return(HWID.Parts[0] == "OK" && HWID.timeleft > 0L);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Пример #12
0
 public static string GetCpuID()
 {
     try
     {
         ManagementObjectCollection instances = new ManagementClass("Win32_Processor").GetInstances();
         string result = null;
         using (ManagementObjectCollection.ManagementObjectEnumerator managementObjectEnumerator = instances.GetEnumerator())
         {
             if (managementObjectEnumerator.MoveNext())
             {
                 result = ((ManagementObject)managementObjectEnumerator.Current).Properties["ProcessorId"].Value.ToString();
             }
         }
         return(result);
     }
     catch
     {
         return("");
     }
 }
Пример #13
0
        public static string GetMotherBoardSerialNumber()
        {
            ManagementObjectCollection instances = new ManagementClass("WIN32_BaseBoard").GetInstances();
            string result = "";

            using (ManagementObjectCollection.ManagementObjectEnumerator managementObjectEnumerator = instances.GetEnumerator())
            {
                if (managementObjectEnumerator.MoveNext())
                {
                    return(((ManagementObject)managementObjectEnumerator.Current)["SerialNumber"].ToString());
                }
                return(result);
            }
        }
Пример #14
0
        public static string smethod_0()
        {
            ManagementObjectCollection instances = new ManagementClass("win32_processor").GetInstances();
            string empty = string.Empty;

            using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    empty = enumerator.Current.Properties["processorID"].Value.ToString();
                }
            }
            return(empty);
        }