How can i get ip address of system by sending mac ip address as input using vb.net coding?
Here is Example for this. In this example we can get IP address of our given host name.
Dim strHostName As String = "jayeshsorathia.blogspot.com"
'string strHostName = "www.microsoft.com";
' Get DNS entry of specified host name
Dim addresses As IPAddress() = Dns.GetHostEntry(strHostName).AddressList
' The DNS entry may contains more than one IP addresses.
' Iterate them and display each along with the type of address (AddressFamily).
For Each address As IPAddress In addresses
Response.Write(String.Format("{0} = {1} ({2})", strHostName, address, address.AddressFamily))
Response.Write("<br/><br/>")
Next
Private Function GetIPv4Address() As String
GetIPv4Address = String.Empty
Dim strHostName As String = System.Net.Dns.GetHostName()
Dim iphe As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(strHostName)
For Each ipheal As System.Net.IPAddress In iphe.AddressList
If ipheal.AddressFamily = System.Net.Sockets.AddressFamily.InterNetwork Then
GetIPv4Address = ipheal.ToString()
End If
Next
End Function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With