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);
            }



请大婶指点、感觉用户多会冲突

本文标签: 腾讯一键企业邮箱邮件