看见月亮成猩猩,按国际惯例低调散分,见者有份
贴一个技术贴,免得被放逐到水区:
//项目中添加Micrsoft.mshtml引用
using mshtml;
private void Form1_Load(object sender, EventArgs e)
{
webBrowser1.Navigate( "http://www.baidu.com ");
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
IHTMLDocument2 vDocument = (IHTMLDocument2)webBrowser1.Document.DomDocument;
IHTMLBodyElement vBody = (IHTMLBodyElement)vDocument.body;
IHTMLTxtRange vTxtRange = (IHTMLTxtRange)vBody.createTextRange();
if (vTxtRange.findText( "关于百度 ", int.MaxValue, 0))
{
vTxtRange.select();
vTxtRange.pasteHTML(
@ " <a href= " "http://blog.sina.com.cn/zswang " " " +
@ "target= " "_blank " "> <b> Zswang </b> 路过 </a> ");
}
}
//---------------
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate( "http://www.baidu.com ")
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Dim vDocument As mshtml.IHTMLDocument2 = WebBrowser1.Document.DomDocument
Dim vBody As mshtml.IHTMLBodyElement = vDocument.body
Dim vTxtRange As mshtml.IHTMLTxtRange = vBody.createTextRange
If vTxtRange.findText( "关于百度 ") Then
vTxtRange.select()
vTxtRange.pasteHTML( " <a href= " "http://blog.sina.com.cn/zswang " " target= " "_blank " "> <b> Zswang </b> 路过 </a> ")
End If
End Sub
周二结贴。
------解决方案--------------------jf
------解决方案--------------------DDD
------解决方案--------------------我先来
------解决方案--------------------up up up
------解决方案--------------------刚在另一个帖子里看到,呵呵,恭喜恭喜
------解决方案--------------------呵呵,兄弟水平比较洼,要同喜估计还得个一周左右
现在还在努力,一边学习,一边摘星星
------解决方案--------------------