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
Post a Comment