i was working on c# app chatting on local network so that the computers clients and server connected to the same router
i have computer A and computer B in computer A i tried
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
IPAddress[]ips= Dns.GetHostAddresses("Server Name");
for (int i = 0; i < ips.Length; i++)
{
Console.WriteLine(ips[i].ToString());
}
}
}
}
so that B is the sever then i get this output
fe80::c199:7c21:1a54:f326%2
fe80::94a5:59a1:bb70:3cd9%23
fe80::a150:7e47:ee9c:5194%20
192.168.40.1
192.168.133.1
192.168.1.8
Press any key to continue . . .
i got 6 different ips first 3 ip v6 and the second 3 are ip v4 there is addresses for vmware and lan and wifi i know that the last one is the WIFI interface ip by typing ipconfig on cmd but i want this to be automatically how to know what is the ip address of server Wifi interface ?