J
James R. Atherton
I borrowed some code (Listed below) in VB.NET 2002, and it works great. I
upgraded to 2003 and although this snippet still works, the
(.AddressList(0).Address) portion of it has a squiggly line under it and
states the following:
'Public Property Address() As Long' is obsolete: 'IPAddress.Address is
address family dependant, use Equals method for comparison.'
I would like to fix this, but have no idea how. It's not failing out my
code, but I still want to fix the issue. Any thoughts?
Shared Function GetIPAddress() As String
Dim Address As System.Net.IPAddress
With System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName())
Address = New System.Net.IPAddress(.AddressList(0).Address)
End With
GetIPAddress = Address.ToString
End Function
upgraded to 2003 and although this snippet still works, the
(.AddressList(0).Address) portion of it has a squiggly line under it and
states the following:
'Public Property Address() As Long' is obsolete: 'IPAddress.Address is
address family dependant, use Equals method for comparison.'
I would like to fix this, but have no idea how. It's not failing out my
code, but I still want to fix the issue. Any thoughts?
Shared Function GetIPAddress() As String
Dim Address As System.Net.IPAddress
With System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName())
Address = New System.Net.IPAddress(.AddressList(0).Address)
End With
GetIPAddress = Address.ToString
End Function