本文介绍了我怎样才能获得C#分清不明确的类名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何得到C#来暧昧类类型区分,而不必每次都指定完整的 HtmlAgilityPack.HtmlDocument
名称(相对于 System.Windows.Forms.HtmlDocument )?
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 compared to System.Windows.Forms.HtmlDocument
)?
有没有办法让C#知道,我总是在谈论一个类或其他,因而不必每次我用它时都指定了?
Is there a way to make C# know that I am ALWAYS talking about one class or the other, and thus not have to specify it each time I use it?
推荐答案
使用的别名:
using HapHtmlDocument = HtmlAgilityPack.HtmlDocument;
using WfHtmlDocument = System.Windows.Forms.HtmlDocument;
这篇关于我怎样才能获得C#分清不明确的类名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!