سلام بر تمامی پروگرم نود و هشتیها و تمامی برنامه نویس های سی شارپ و دات نت !!! در این مطلب از سری کد های سی شارپ ، کد تشخیص تمام ip adress ها از LAN در سی شارپ رو براتون آماده کردم.انشاالله که این کد به دردتون بخوره.
cmbIPAddress یک کامبوباکس می باشد و ip adress ها را نمایش میدهد.
//detect all ip adresses from a lan
string strHostName = string.Empty;
cmbIPAddress.Items.Clear();
// Getting Ip address of local machine...
// First get the host name of local machine.
strHostName = Dns.GetHostName();
// Then using host name, get the IP address list..
IPHostEntry ipEntry = Dns.GetHostByName(strHostName);
string strHostName = string.Empty;
cmbIPAddress.Items.Clear();
// Getting Ip address of local machine...
// First get the host name of local machine.
strHostName = Dns.GetHostName();
// Then using host name, get the IP address list..
IPHostEntry ipEntry = Dns.GetHostByName(strHostName);