这是我第一次使用HAP工作,但我发现HtmlDocument
类存在问题,我无法使用它,因为intellisense告诉我它是模糊的引用,这是图片:
我已经导入了这个代码需要它的库using HTML_Agility;
using HtmlAgilityPack;
并且我还添加了对它的DLL文件的引用,但它对我帮助不大。你知道为什么会这样吗?如何修复它?
答案 0 :(得分:3)
还有一个System.Windows.Forms.HtmlDocument
类。
尝试明确限定您的类名,而不是使用using
语句,或使用using
语句重命名该类,例如using HAPDocument = HtmlAgilityPack.HtmlDocument;
(然后使用HAPDocument
代替{您的源代码中的{1}}。
答案 1 :(得分:2)
为了避免模糊的引用写这样:
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();