How Can I Get C# To Distinguish Between Ambiguous Class Names?

后端 未结 3 670
遥遥无期
遥遥无期 2021-02-07 08:21

How can I get C# to distinguish between ambiguous class types without having to specify the full HtmlAgilityPack.HtmlDocument name every time (it is ambiguous compa

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-07 09:03

    You can define an alias for one namespace, e.g:

    using hap = HtmlAgilityPack;
    

    and then use the alias instead of the full namespace:

    hap.HtmlDocument doc = new hap.HtmlDocument;
    

提交回复
热议问题