求大神帮帮忙WebBrowser
解决方案 »
- 请教一个关于treeview的问题
- c++游戏开发需要学习什么,c#和c++开发游戏那个效率高,质量高?
- 回车换行
- 我想请问一下: Visual C# MVP 和 Asp.net MVP 有什么区别?? C#不就是用来开发Asp.net的吗?
- 微软的bug(分布式事务),试用了微软提供的解决方案,但还是没有用,碰过这种问题的大虾请过来看看
- 请教OLE DB和ODBC这两种连接方式的区别(.net 2.0)
- 我现在想搞个象Windows自带的绘图工具,不知道应该用哪些控件,名字叫什么?请帮帮忙!谢谢,200分,另开贴给分!(给分帖)
- 用C#开发一个ftp客户端
- 寻求把一个数组里的数据 插入数据库的合理方法
- 关于dll调用的问题,很简单的,可是我不太明白
- 由GraphicsPath组合的一组路径,如何判断它是不是一个圆?
- webBrowser與 InvokeMember
然后C# Win32API 模拟鼠标移动及点击事件
http://www.cnblogs.com/08shiyan/archive/2011/07/18/2109086.html
HtmlElement html= webBrowser1.Document.GetElementById("id");
html.InvokeMember("click");
HtmlElement password = webBrowser1.Document.All.GetElementsByName("password")[0];//通过name获取
password.InnerText = "456abc";
password.InvokeMember("click");
password.Focus();//有些页面给控件添加了Focus属性
HtmlElement regemailinput = webBrowser1.Document.GetElementById("regemailinput");//通过ID获取
regemailinput.InvokeMember("click");
private void Form1_Load(object sender, EventArgs e)
{
this.webBrowser1.Url = new Uri("http://www.baidu.com");
} private void button1_Click(object sender, EventArgs e)
{
HtmlElement searchWords = webBrowser1.Document.All["kw"];
HtmlElement searchButton = webBrowser1.Document.All["su"];
searchWords.SetAttribute("value", "guwei4037");
searchButton.InvokeMember("click");
}
2
3
4
5
6
7
HtmlDocument htmlDoc = webBrowser1.Document.Window.Frames["mainFrame"].Document;
if (htmlDoc != null)
{
string qssj = htmlDoc.All["ajc10a"].GetAttribute("value");
string jssj = htmlDoc.All["ajc10b"].GetAttribute("value");
}