IPAddress类的实例问题
来源:百度知道 编辑:UC知道 时间:2024/06/22 02:55:11
Dim heserver As IPHostEntry = Dns.Resolve(server)
这一行显示错误:
“Public Shared Function Resolve(hostName As String) As System.Net.IPHostEntry”已过时:“Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202”
请问怎么样改啊?
这一行显示错误:
“Public Shared Function Resolve(hostName As String) As System.Net.IPHostEntry”已过时:“Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202”
请问怎么样改啊?
这表示Dns.Resolve这种调用方式已经过期(deprecated,也就是在上一版本的framework中使用,而在当前版本的framework中使用Obsolete属性进行了标记),请使用Dns.GetHostEntry方法来获得IPHostEntry对象。
使用Dns.GetHostEntry!!!!
原来那个函数现在已经不用了!!