Network Commands in VB.NET

A couple of useful network commands in Visual BASIC .NET (2005). These are the equivalents of doing ping and nslookup from the command prompt. The variable sIPAddress in these examples is a string containing the IP to test, i.e. "127.0.0.1"

ping

1My.Computer.Network.Ping(sIPAddress)

nslookup

1System.Net.Dns.GetHostEntry(sIPAddress).HostName