How do I get a computer's programing name and static IP address using VB.NET? -


public function getcomputername() string     dim computername string     computername = system.net.dns.gethostname     return computername end function 

for pc name use:

 my.computer.name 

for ip use:

 private sub getipaddress()   dim strhostname string   dim stripaddress string   strhostname = system.net.dns.gethostname()   stripaddress = system.net.dns.gethostbyname(strhostname).addresslist(0).tostring()   messagebox.show("host name: " & strhostname & "; ip address: " & stripaddress)  end sub 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -