我要插入的这段html不是固定的,我希望在鼠标选中或者光标所在的地方插入html,请问应该如何实现呀?
解决方案 »
- 多线程处理,求帮助
- 如何重构实现以下多次网络请求算法
- 【100分了】sql 日期格式问题
- 水晶报表的显示问题
- 怎么获取 string[] arrayID=strID.Split('-'); 数组中的内容:刚学,请教!!!
- C# winfrom combobox 有2个combobox
- 未处理的“System.ObjectDisposedException”类型的异常出现在 system.windows.forms.dll 中
- 如何读文本文件内容存入数据库中?
- 又是datagrid
- c#中怎么没有TreeView呀???
- .NET中用什么软件进行界面设计呢C&C/S结构的
- 关于BHO,webbrowser,定位截屏及呼出模态窗口的问题
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, EventArgs e)
{
IHTMLDocument2 doc = (IHTMLDocument2)this.webBrowser1.Document.DomDocument;
IHTMLTxtRange range = doc.selection.createRange() as IHTMLTxtRange;
range.pasteHTML(range.text+"<div>jinjazz 路过</div>");
}
}
}
--〉
range.pasteHTML(div>jinjazz 路过</div>");