Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

阻止登录时的错误弹出 #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion BaiduPanDownload/Forms/Login.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public Login()
private void Login_Load(object sender, EventArgs e)
{
webBrowser1.Url = new Uri("http://www.139.sh");
webBrowser1.ScriptErrorsSuppressed = true;

}

private void button1_Click(object sender, EventArgs e)
Expand All @@ -59,7 +61,13 @@ private void button1_Click(object sender, EventArgs e)

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{

if (webBrowser1.Document != null)
if (webBrowser1.Document.Window != null)
webBrowser1.Document.Window.Error += Window_Error;
}
void Window_Error(object sender, HtmlElementErrorEventArgs e)
{
e.Handled = true;
}
string GetCookies(string url)
{
Expand Down