problème fonction avec vb 2008
bonjour à tous;
voilà j'ai une problème dans ma fonction dont voilà le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Function GetIPAddress(ByVal CompName As String) As String
Dim oAddr As System.Net.IPAddress
Dim sAddr As String
Try
With System.Net.Dns.GetHostByName(CompName)
oAddr = New System.Net.IPAddress(.AddressList(0).Address)
sAddr = oAddr.ToString
End With
GetIPAddress = sAddr
Catch Excep As Exception
MsgBox(Excep.Message, MsgBoxStyle.OKOnly, "Lan Messenger")
Finally
End Try
End Function |
le problème se situe au niveau de
Code:
1 2
| With System.Net.Dns.GetHostByName(CompName)
oAddr = New System.Net.IPAddress(.AddressList(0).Address) |
ce que j'ai est un warning qui me dit
Citation:
Warning 1 'Public Shared Function GetHostByName(hostName As String) As System.Net.IPHostEntry' is obsolete: 'GetHostByName is obsoleted for this type, please use GetHostEntry instead.
http://go.microsoft.com/fwlink/?linkid=14202'. C:\Documents and Settings\Administrateur\Mes documents\MyLanApp\MyLanApp\Form1.vb 215 18 MyLanApp
et un autre qui me dit
Citation:
Warning 2 'Public Property Address() As Long' is obsolete: 'This property has been deprecated. It is address family dependent. Please use IPAddress.Equals method to perform comparisons.
http://go.microsoft.com/fwlink/?linkid=14202'. C:\Documents and Settings\Administrateur\Mes documents\MyLanApp\MyLanApp\Form1.vb 216 50 MyLanApp
merci de m'aider ;)