Esempio n. 1
0
        private void b_MacAdrs_Click(object sender, EventArgs e)
        {
            string mac = "";

            foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
            {
                if (nic.OperationalStatus == OperationalStatus.Up && (!nic.Description.Contains("Virtual") && !nic.Description.Contains("Pseudo")))
                {
                    if (nic.GetPhysicalAddress().ToString() != "")
                    {
                        mac = nic.GetPhysicalAddress().ToString();
                    }
                }
            }
            //MessageBox.Show(mac);

            API_DeviceCode code = new API_DeviceCode();

            code.cek_storeCode();
            DeviceCode = code.GetDeviceId(mac);
            //MessageBox.Show(DeviceCode);
        }
Esempio n. 2
0
        //================================================================
        public void MethodGetDevId()
        {
            string mac = "";

            foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
            {
                if (nic.OperationalStatus == OperationalStatus.Up && (!nic.Description.Contains("Virtual") && !nic.Description.Contains("Pseudo")))
                {
                    if (nic.GetPhysicalAddress().ToString() != "")
                    {
                        mac = nic.GetPhysicalAddress().ToString();
                    }
                }
            }
            //MessageBox.Show(mac);

            API_DeviceCode code = new API_DeviceCode();

            //code.LinkGetCode(txtOff.Text);
            code.cek_storeCode();
            DeviceCode = code.GetDeviceId(mac);
            //MessageBox.Show(DeviceCode);
        }