C# 在 webBrowser 光标处插入 html代码 private void BtnInsertMedia_Click(object sender, EventArgs e) { InWord frm = new InWord("请填入视频地址(后缀必须是.swf):"); frm.ShowDialog(); if (frm.Value != null && frm.Value != "") { IHTMLDocument2 doc = (IHTMLDocument2)this.webBrowser1.Document.DomDocument; IHTMLTxtRange range = doc.selection.createRange() as IHTMLTxtRange; range.pasteHTML(range.text + @"<br /><embed wmode=""transparent"" src=""" + frm.Value + @""" quality=""high"" width=""480"" height=""400"" align=""middle"" allow script Access=""always"" allowfullscreen=""true"" type=""application/x-shockwave-flash""></embed><br />"); } }