C# Form Uygulamaları - Ip ve Mac Adresi Bulma
Uygulamayı İndir


private void Form1_Load(object sender, EventArgs e)
        {
          
            foreach (NetworkInterface networkInterface in NetworkInterface.GetAllNetworkInterfaces())
            {
                var macAddress = networkInterface.GetPhysicalAddress().ToString();
                if (macAddress != string.Empty)
                {
                    listBox1.Items.Add("Mac Adres : " + macAddress);
                }
            }


            IPAddress[] ipHostAddress = Dns.GetHostAddresses(Dns.GetHostName());
            for (int i = 0; i < ipHostAddress.Length; i++)
            {
                listBox1.Items.Add("Lokal IP Adres : " + ipHostAddress[i].ToString());
            }
        }
        }

Yorum Gönder Blogger

 
Üst