求C#高手帮忙,酬劳50分,在线等待~~~~~~~~~~

来源:百度知道 编辑:UC知道 时间:2024/06/08 06:40:33
我想用一个WINFORM中实现这样的功能
我点一个铵钮就能自己动登录到一个要求有安全证书的网站中去,并且要跳过登录页面,当然登录用的用户名和密码是知道的。
有能提供帮助的人,加分50,说到做到。

SHDocVw.InternetExplorer IE = new InternetExplorer();

public void GotoURL(string URL)
{
//实例化一个IE模型

IE.Visible = true;
object nullArg = null;
//引导到URL
IE.Navigate(URL, ref nullArg, ref nullArg, ref nullArg, ref nullArg);
}

//下面是事件
this.GotoURL("http://reg.163.com/RetakePasswdByAnswer.shtml");
Thread.Sleep(500);
//得到IE的文档对象模型
mshtml.IHTMLDocument2 DOM = (mshtml.IHTMLDocument2)IE.Document;
//声明用户名
mshtml.IHTMLInputTextElement txtUserName = (mshtml.IHTMLInputTextElement)DOM.all.item("username", null);
txtUserName.value = username;
//年