admin管理员组文章数量:1559766
try
{
//OAuth授权sojiqi
string returnJson = HttpRequest.RequestUrl("https://exmail.qq/cgi-bin/token", "grant_type=client_credentials&client_id=xxxxx&client_secret=xxxxxxxxx", "POST");
//登录
if (returnJson != string.Empty)
{
access_token = JsonText(returnJson)[0];
}
if (access_token != string.Empty)
{
//客户端维持长连接
string returnRet = HttpRequest.RequestUrl("http://openapi.exmail.qq:12211/openapi/listen", "access_token=" + access_token + "&alias=" + emial , "POST");
string ret = JsonText(returnRet)[0];
if (ret != null && Convert.ToInt32(ret) != 0)
{
Logger.WriteLog("客户端未连接", "");
ValidateAuth();
return;
}
//读取未读邮件
string mailList = HttpRequest.RequestUrl("http://openapi.exmail.qq:12211/openapi/mail/newcount", "access_token=" + access_token + "&alias=" + emial + "", "POST");
string count = JsonText(mailList)[1];
string email = JsonText(mailList)[0];
newCount = Convert.ToInt32(count);
if (newCount == 0)
{
this.timer1.Interval = 5000;
return;
}
this.timer1.Interval = 1000 * 20;
//获取authkey
string authkeyjson = HttpRequest.RequestUrl("http://openapi.exmail.qq:12211/openapi/mail/authkey", "access_token=" + access_token + "&alias=" + email, "POST");
string authkey = JsonText(authkeyjson)[0];
//一键登录
string url = "https://exmail.qq/cgi-bin/login?fun=bizopenssologin&method=bizauth&agent=xxxxx&user=" + email + "&ticket=" + authkey;
ShowMessage(email, count, url);
}
else
{
ValidateAuth();
}
}
catch (Exception ex)
{
Logger.WriteLog("重新验证授权", ex.Message);
}
请大婶指点、感觉用户多会冲突
版权声明:本文标题:c# 腾讯企业邮箱 邮件提醒和一键登录 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1727422793a1113771.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论