Ejemplo n.º 1
0
        void AddHardDiskInfo()
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                                                 "SELECT * FROM Win32_DiskDrive");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    InformString.Append(queryObj["Model"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    //InformString.Append(queryObj["SerialNumber"]);
                    //InformString.Append((char)13);
                    //InformString.Append((char)10);
                    InformString.Append(queryObj["Signature"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    InformString.Append(queryObj["Size"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    break;
                }
            }
            catch
            {
                //InformString.Append(Dns.GetHostName());
            }
        }
Ejemplo n.º 2
0
        void AddProcessorInfo()
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                                                 "SELECT * FROM Win32_Processor");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    InformString.Append(queryObj["Caption"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    InformString.Append(queryObj["Manufacturer"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    InformString.Append(queryObj["Name"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    InformString.Append(queryObj["ProcessorId"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    InformString.Append(queryObj["Revision"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 3
0
        void AddNetworkAdapterInfo()
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                                                 "SELECT * FROM Win32_NetworkAdapter");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    InformString.Append(queryObj["AdapterType"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    InformString.Append(queryObj["Description"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    InformString.Append(queryObj["DeviceID"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                    InformString.Append(queryObj["MACAddress"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 4
0
 void AddMotherboardInfo()
 {
     try
     {
         ObjectQuery MotherboardQuery = new System.Management.ObjectQuery("select Product, Caption, Description, SerialNumber, Manufacturer, Version from Win32_BaseBoard");
         ManagementObjectSearcher   MotherboardSearcher   = new ManagementObjectSearcher(MotherboardQuery);
         ManagementObjectCollection MotherboardCollection = MotherboardSearcher.Get();
         foreach (ManagementObject MotherboardInfo in MotherboardCollection)
         {
             InformString.Append(MotherboardInfo["Manufacturer"].ToString());
             InformString.Append((char)13);
             InformString.Append((char)10);
             InformString.Append(MotherboardInfo["Product"].ToString());
             InformString.Append((char)13);
             InformString.Append((char)10);
             InformString.Append(MotherboardInfo["SerialNumber"].ToString());
             InformString.Append((char)13);
             InformString.Append((char)10);
             InformString.Append(MotherboardInfo["Version"].ToString());
             InformString.Append((char)13);
             InformString.Append((char)10);
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 5
0
        public void CalcHash()
        {
            StringBuilder s = new StringBuilder();

            foreach (byte b in SHA1.Create().ComputeHash(Encoding.ASCII.GetBytes(InformString.ToString())))
            {
                s.Append(b.ToString("x2"));
            }

            HashCode = s.ToString();
        }
Ejemplo n.º 6
0
        void AddUSBInfo()
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                                                 "SELECT * FROM Win32_USBController");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    InformString.Append(queryObj["Caption"]);
                    InformString.Append(queryObj["DeviceID"]);
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 7
0
 void AddVideocardInfo()
 {
     try
     {
         ObjectQuery VideocardQuery = new System.Management.ObjectQuery("select Caption, Description, DeviceID from Win32_VideoController");
         ManagementObjectSearcher   VideocardSearcher   = new ManagementObjectSearcher(VideocardQuery);
         ManagementObjectCollection VideocardCollection = VideocardSearcher.Get();
         foreach (ManagementObject VideocardInfo in VideocardCollection)
         {
             InformString.Append(VideocardInfo["Caption"].ToString());
         }
         InformString.Append((char)13);
         InformString.Append((char)10);
     }
     catch
     {
     }
 }
Ejemplo n.º 8
0
        void AddSoundcardInfo()
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                                                 "SELECT * FROM Win32_SoundDevice");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    InformString.Append(queryObj["DeviceID"]);
                    InformString.Append(queryObj["Manufacturer"]);
                    InformString.Append(queryObj["ProductName"]);
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 9
0
        void AddPhysicalMediaInfo()
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                                                 "SELECT * FROM Win32_PhysicalMedia");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    InformString.Append(queryObj["SerialNumber"]);
                    InformString.Append(queryObj["Tag"]);
                    InformString.Append((char)13);
                    InformString.Append((char)10);
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 10
0
 void AddLogicDiskInfo()
 {
     try
     {
         ObjectQuery DiskQuery = new System.Management.ObjectQuery("select FreeSpace, FileSystem, Size, Name, VolumeName, VolumeSerialNumber from Win32_LogicalDisk where DriveType = 3");
         ManagementObjectSearcher   DiskSearcher   = new ManagementObjectSearcher(DiskQuery);
         ManagementObjectCollection DiskCollection = DiskSearcher.Get();
         foreach (ManagementObject DiskInfo in DiskCollection)
         {
             InformString.Append(DiskInfo["Name"].ToString());
             InformString.Append(DiskInfo["Size"].ToString());
             InformString.Append(DiskInfo["VolumeName"].ToString());
             InformString.Append(DiskInfo["FileSystem"].ToString());
             InformString.Append(DiskInfo["FreeSpace"].ToString());
             InformString.Append(DiskInfo["VolumeSerialNumber"].ToString());
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 11
0
        void AddBIOSInfo()
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                                                 "SELECT * FROM Win32_BIOS");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    if (queryObj["BIOSVersion"] == null)
                    {
                        InformString.Append(queryObj["BIOSVersion"]);
                    }
                    else
                    {
                        String[] arrBIOSVersion = (String[])(queryObj["BIOSVersion"]);
                        foreach (String arrValue in arrBIOSVersion)
                        {
                            InformString.Append(arrValue);
                        }
                    }
                    InformString.Append(queryObj["BuildNumber"]);
                    InformString.Append(queryObj["Caption"]);
                    InformString.Append(queryObj["CodeSet"]);
                    InformString.Append(queryObj["CurrentLanguage"]);
                    InformString.Append(queryObj["Description"]);
                    InformString.Append(queryObj["IdentificationCode"]);
                    InformString.Append(queryObj["InstallableLanguages"]);
                    InformString.Append(queryObj["InstallDate"]);
                    InformString.Append(queryObj["LanguageEdition"]);

                    if (queryObj["ListOfLanguages"] == null)
                    {
                        InformString.Append(queryObj["ListOfLanguages"]);
                    }
                    else
                    {
                        String[] arrListOfLanguages = (String[])(queryObj["ListOfLanguages"]);
                        foreach (String arrValue in arrListOfLanguages)
                        {
                            InformString.Append(arrValue);
                        }
                    }
                    InformString.Append(queryObj["Manufacturer"]);
                    InformString.Append(queryObj["Name"]);
                    InformString.Append(queryObj["OtherTargetOS"]);
                    InformString.Append(queryObj["PrimaryBIOS"]);
                    InformString.Append(queryObj["ReleaseDate"]);
                    InformString.Append(queryObj["SerialNumber"]);
                    InformString.Append(queryObj["SMBIOSBIOSVersion"]);
                    InformString.Append(queryObj["SMBIOSMajorVersion"]);
                    InformString.Append(queryObj["SMBIOSMinorVersion"]);
                    InformString.Append(queryObj["SMBIOSPresent"]);
                    InformString.Append(queryObj["SoftwareElementID"]);
                    InformString.Append(queryObj["SoftwareElementState"]);
                    InformString.Append(queryObj["Status"]);
                    InformString.Append(queryObj["TargetOperatingSystem"]);
                    InformString.Append(queryObj["Version"]);
                }
            }
            catch
            {
            }
        }