C# - How To Get Your IP Address Using Visual Studio 2019 with source code

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ม.ค. 2025

ความคิดเห็น • 1

  • @knightsvip1693
    @knightsvip1693 ปีที่แล้ว

    sorry to make a mistake from ur video but real code never get underlined in visual studio its bad to talk about it sorry but real code is
    IPHostEntry iPHost;
    string localIp = "";
    iPHost= Dns.GetHostEntry(Dns.GetHostName());
    foreach (IPAddress ip in iPHost.AddressList)
    {
    if (ip.AddressFamily.ToString() == "InterNetwork")
    localIp = ip.ToString();
    listBox1.Items.Add(localIp);
    thank you very much