'Public Shared Function Resolve(hostName As String) As System.Net.IPHostEntry' is obsolete: 'Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202'.
'Code (VB.NET)
Class constructor overloaded
Public Sub New(ByVal ServerAddr As String, ByVal FtpPort As Int32)
Try
BuildConnection(Dns.Resolve(ServerAddr).AddressList(0), FtpPort) 'เกิดที่บรรทัด นี้ครับ
Catch err As Exception
MsgBox(err.ToString())
Me.Dispose()
End Try
End Sub
Public Shared Sub DoGetHostEntry(ByVal hostname As String)
Dim host As IPHostEntry
host = Dns.GetHostEntry(hostname)
Console.WriteLine("GetHostEntry({0}) returns:", hostname)
For Each ip As IPAddress In host.AddressList
Console.WriteLine(" {0}", ip)
Next ip
End Sub