½Ã½ºÅÛ ID Àбâ

¹«¾Æ   
   Á¶È¸ 4034   Ãßõ 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 22/77
2015-12   1409842   ¹é¸Þ°¡
2014-05   4864638   Á¤ÀºÁØ1
2013-12   68602   ¿ÀÀçÈ£
2018-01   23009   ¶Ç¸®±º
2013-12   39941   ÇöÁø
2014-05   29776   inoree
2018-01   18245   ¶Ç¸®±º
2013-12   26523   ±èȲÁß
2018-01   25695   catstyle
2013-12   18954   ȲÁø¿ì
2014-01   18306   ¾Æ¸§´Ù¿î³ëÀ»
2014-01   19152   theÃ̳ð
2014-01   21545   ±èȲÁß
2014-01   37082   ±èȲÁß
2014-01   38271   ȸ¿øK
2014-01   41130   stone92±è°æ¹Î
2014-01   40485   ±èȲÁß
2014-01   70824   ±èȲÁß
2014-01   63132   ȸ¿øK
2014-01   54675   ȸ¿øK
2014-01   53626   ¿¥ºê¸®¿À
2014-01   51110   ±èȲÁß