使用SmtpClient从Gmail注销 [英] sign out from Gmail with SmtpClient
本文介绍了使用SmtpClient从Gmail注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好
我无法从Gmail退出。
Hello
I can not sign out from Gmail.
webBrowser_1.Document.GetElementById("sign out").InvokeMember("click");
推荐答案
您只需导航到此网址:
https://accounts.google.com/logout [ ^ ]
You only need to navigate to this url:
https://accounts.google.com/logout[^]
string url = "https://accounts.google.com/logout";
this.webBrowser_1.Navigate(url);
我只用了这段代码。现在我可以断开与Gmail的连接。
private void button_Disconnect_Click(对象发送者,EventArgs e)
{
尝试
{
webBrowser_1.DocumentCompleted - = new WebBrowserDocumentCompletedEventHandler(SetValues);
label_disconnection.Visible = true;
label_connecttogmail.Visible = false;
textBox_From.Text =;
}
catch(例外情况)
{
MessageBox.Show(ex.ToString());
}
I used just this code. Now I can disconnect from Gmail.
private void button_Disconnect_Click(object sender, EventArgs e)
{
try
{
webBrowser_1.DocumentCompleted -= new WebBrowserDocumentCompletedEventHandler(SetValues);
label_disconnection.Visible = true;
label_connecttogmail.Visible = false;
textBox_From.Text = "";
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
这篇关于使用SmtpClient从Gmail注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文