“System.NullReferenceException”类型的异常在

burunichuna burunichuna 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
HtmlElement tbuserid = webBrowser1.Document.GetElementById("username");
tbuserid.SetAttribute("value", this.textBox1.Text);
HtmlElement tbupasswd = webBrowser1.Document.GetElementById("password");
tbupasswd.SetAttribute("value", this.textBox2.Text);
HtmlElement btnlogin = webBrowser1.Document.GetElementById("submit");
btnlogin.InvokeMember("click");
System.Threading.Thread.Sleep(1500);
}

我在做一个自动登录 但是提示报错
就是一别人的一个网页,我用客户端去登录


“System.NullReferenceException”类型的异常在 zddl.exe 中发生,但未在用户代码中进行处理
btnlogin.InvokeMember("click"); 这个地方报错

额,我客户端不太懂.
有大牛能说下么
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
burunichuna
C# 111,130 成员 642,541 内容