using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using mshtml; // 添加引用.Net-Microsoft.mshtml namespace WindowsApplication29 ... { public partial class Form1:Form ... { public Form1() ... { InitializeComponent(); this .webBrowser1.Navigate( " www.google.cn " ); } private void button1_Click( object sender,EventArgse) ... { IHTMLDocument2doc = (IHTMLDocument2) this .webBrowser1.Document.DomDocument; IHTMLTxtRangerange = doc.selection.createRange() as IHTMLTxtRange; range.pasteHTML(range.text + " <div>jinjazz路过</div> " ); } } }