Esempio n. 1
0
        public static string GetUCID()
        {
            string BIOS = "";

            ManagementClass            mc  = new ManagementClass("Win32_BIOS");
            ManagementObjectCollection moc = mc.GetInstances();

            foreach (ManagementBaseObject mo in moc)
            {
                BIOS = GetFromMO(mo, "Manufacturer") + GetFromMO(mo, "IdentificationCode") + GetFromMO(mo, "SerialNumber");
            }

            string CPUID = "";

            mc  = new ManagementClass("Win32_Processor");
            moc = mc.GetInstances();
            foreach (ManagementBaseObject mo in moc)
            {
                if (CPUID == "")
                {
                    CPUID = GetFromMO(mo, "UniqueId");
                }
                if (CPUID == "")
                {
                    CPUID = GetFromMO(mo, "ProcessorId");
                }
                if (CPUID == "")
                {
                    CPUID = GetFromMO(mo, "Name");
                    if (CPUID == "")
                    {
                        CPUID = GetFromMO(mo, "Manufacturer");
                    }
                    CPUID += GetFromMO(mo, "MaxClockSpeed");
                }
            }

            string BASEBOARD = "";

            mc  = new ManagementClass("Win32_Baseboard");
            moc = mc.GetInstances();
            foreach (ManagementBaseObject mo in moc)
            {
                BASEBOARD = GetFromMO(mo, "SerialNumber");
            }

            string ID = "BIOS>>" + BIOS + "CPU>>" + CPUID + "BB>>" + BASEBOARD;

            return(MD5Utilities.CalcMD5(ID));
        }
Esempio n. 2
0
 public static void CalcEventLogID(EventLogReport ev)
 {
     ev.LogID = MD5Utilities.CalcMD5(ev.Source + ev.Category + ev.EventLog + ev.InstanceID.ToString() + ev.TimeGenerated.ToString("yyyyMMddHHmmss") + ev.TimeWritten.ToString("yyyyMMddHHmmss") + ev.Message);
 }