zoukankan      html  css  js  c++  java
  • System.Net.Dns.GetHostByAddress(string) 已经过时

    对一个旧专案进行修改,修改完毕之后,进行编译,修改部份没有问题,反而在另外一页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;

     终于编译通过。

  • 相关阅读:
    Python Day14
    Python Day13
    Python Day12
    Python Day11
    Python Day10
    Python Day9
    Python Day8
    Python Day7
    Python Day6
    Python Day5
  • 原文地址:https://www.cnblogs.com/insus/p/1682523.html
Copyright © 2011-2022 走看看