【发布时间】:2011-12-25 16:35:19
【问题描述】:
底层代码,选择你想要的词。我写了这些话我想点击链接。单词可能是错误的,所以我使用谷歌翻译。只有“范围”值声明如何点击?谢谢。
if (webBrowser1.Document != null)
{
IHTMLDocument2 document = webBrowser1.Document.DomDocument as IHTMLDocument2;
if (document != null)
{
IHTMLSelectionObject currentSelection = document.selection;
IHTMLTxtRange range = currentSelection.createRange() as IHTMLTxtRange;
if (range != null)
{
const String search = "Sayfalar";
if (range.findText(search, search.Length, 2))
{
range.select();
}
}
}
}
【问题讨论】:
标签: c# webbrowser-control