½Ã½ºÅÛ ID Àбâ

¹«¾Æ   
   Á¶È¸ 4787   Ãßõ 2    

BoardIdTest.exe (10.5K), Down : 26, 2019-09

label1.Text = GetMotherBoardID();
label2.Text = GetCpuID();
label3.Text = ComputerSID;
label4.Text = UUID;

 순서로 출력됩니다.

닷넷 4.6 인가 설치되어 있어야 할 겁니다. 윈10 이면 기본으로 설치되어 있을 거구요.




namespace BoardIdTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public static string GetMotherBoardID()
        {
            string mbInfo = String.Empty;
            ManagementScope scope = new ManagementScope("\\\\" + Environment.MachineName + "\\root\\cimv2");
            scope.Connect();
            ManagementObject wmiClass = new ManagementObject(scope, new ManagementPath("Win32_BaseBoard.Tag=\"Base Board\""), new ObjectGetOptions());

            foreach (PropertyData propData in wmiClass.Properties)
            {
                if (propData.Name == "SerialNumber")
                {
                    //mbInfo = String.Format("{0,-25}{1}", propData.Name, Convert.ToString(propData.Value));
                    mbInfo = Convert.ToString(propData.Value);
                    break;
                }
            }
            return mbInfo;
        }
        static private string GetCpuID()
        {
            string cpuInfo = string.Empty;
            ManagementClass mc = new ManagementClass("win32_processor");
            ManagementObjectCollection moc = mc.GetInstances();

            foreach (ManagementObject mo in moc)
            {
                if (cpuInfo == "")
                {
                    //Get only the first CPU's ID
                    cpuInfo = mo.Properties["processorID"].Value.ToString();
                    break;
                }
            }
            return cpuInfo;
        }

        public static string ComputerSID
        {
            get
            {
                string sid = string.Empty;
                string SIDKey = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion";

                RegistryKey baseKey = null;
                if (Environment.Is64BitOperatingSystem)
                {
                    baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
                }
                else
                {
                    baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default);
                }

                RegistryKey key = baseKey.OpenSubKey(SIDKey);

                object keyValue = key.GetValue("ProductId");

                if (keyValue != null)
                {
                    sid = keyValue.ToString();
                }

                key = null;
                keyValue = null;

                return sid;
            }
        }
        public static string UUID
        {
            get
            {
                string uuid = string.Empty;

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

                foreach (ManagementObject mo in moc)
                {
                    uuid = mo.Properties["UUID"].Value.ToString();
                    break;
                }

                return uuid;
            }
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            label1.Text = GetMotherBoardID();
            label2.Text = GetCpuID();
            label3.Text = ComputerSID;
            label4.Text = UUID;
        }

    }

...
ªÀº±Û Àϼö·Ï ½ÅÁßÇϰÔ.


PDS
Á¦¸ñPage 23/78
2015-12   1886819   ¹é¸Þ°¡
2014-05   5372755   Á¤ÀºÁØ1
2015-12   10041   ¼Ò¸Á»ç¶û71
2015-12   10050   ¼Ò¸Á»ç¶û71
2022-05   10054   ÆÄ¶û¹ÎÆ®
2015-12   10057   ¼Ò¸Á»ç¶û71
2022-09   10082   sbg2005
2018-07   10091   ȸ¿øK
2015-12   10091   ¼Ò¸Á»ç¶û71
2015-12   10096   ¼Ò¸Á»ç¶û71
2016-03   10097   ȸ¿øK
2021-09   10100   FOXBI
2022-05   10103   È­Á¤Å¥»ï
2020-04   10175   ¹ÎÁöÆÄÆÄ
2023-12   10198   ¸¶·Î´¸
2015-12   10205   ¼Ò¸Á»ç¶û71
2018-08   10216   »õÇϾᱸ¸§
2019-02   10226   À¸¶óÂ÷Â÷Â÷
2016-03   10227   HEUo±è¿ë¹Î
2018-06   10278   ¹èº´·Ä
2016-11   10294   Ȳ¼ºÁø
2016-04   10302   ¹Ú¸í±ÙTN