对一个旧专案进行修改,修改完毕之后,进行编译,修改部份没有问题,反而在另外一页code没有修改的地方:

System.Net.Dns.GetHostByAddress(Request.UserHostAddress).HostName;

 

却下面的警告:

warning CS0618: 'System.Net.Dns.GetHostByAddress(string)' is obsolete: 'GetHostByAddress is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202'

打开上面的链接,原来微软把这方法废弃了。参照上面警告提示进行修改:

Dns.GetHostEntry(Request.UserHostAddress).HostName;

 终于编译通过。

相关文章:

  • 2021-11-28
  • 2021-12-15
  • 2022-12-23
  • 2022-01-04
  • 2021-12-06
  • 2021-07-17
  • 2021-11-26
  • 2022-02-04
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2021-10-14
  • 2022-01-03
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
相关资源
相似解决方案