Getting the IP Address of the DNS Server(s)

ADO DOT NET

Centurion
Joined
Dec 20, 2006
Hi,
I use this .NET code to get the IP address of all my current DNS server:
Visual Basic:
Imports System.Net.NetworkInformation
Imports System.Net

Dim nics As NetworkInterface()
Dim dnsIPs As IPAddressCollection

nics = NetworkInterface.GetAllNetworkInterfaces()

For Each nic As NetworkInterface In nics
	If (nic.OperationalStatus = OperationalStatus.Up) Then
		dnsIPs = nic.GetIPProperties().DnsAddresses
		For Each dnsIp As IPAddress In dnsIPs
			MessageBox.Show(dnsIp.ToString())
		Next
	End If
Next
It works great but in .NET, I need to do the same also in VB6.
But don't know where to begin, VB6 is too weak! :(
 
Top Bottom