c# - get ip address from client in server -


i using c# framework 4.0 windows form. program installed on server. there 4 light clients connect server.

when 1 of these clients launches progam, how can ip addreess , computer name

try this

   using system; using system.collections.generic; using system.linq; using system.text; using system.net; //include namespace  string hostname = dns.gethostname(); // retrive name of host         console.writeline(hostname);         // ip         string myip = dns.gethostbyname(hostname).addresslist[0].tostring(); 

for more details visit please: http://www.c-sharpcorner.com/uploadfile/167ad2/get-ip-address-using-c-sharp-code/

thanks


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -