亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

? ?? ??? ?? ?? WeChat ?? ??? ?? ?? ??(?? ??)

WeChat ?? ??? ?? ?? ??(?? ??)

Mar 25, 2017 am 09:58 AM

? ?? ?? ?? ??? ?? ??? ?? ?? ??(?? ??)? ???? ????. ??? ?? ?? ??? ?? ??? ??? ???? ????? ???.

???? ?? ?? ??? ???? ????. ?? ??? ??? ????. ??? ???? ??? ???? ?????? ??? ?????. ??? ??? ??? ??? ????.

//定義數(shù)據(jù)模型
 
public class Access_token
{
public Access_token()
{
//
// TODO: 在此處添加構(gòu)造函數(shù)邏輯
//
}
string _access_token;
string _expires_in;
 
///
 
 
/// 獲取到的憑證
///
 
public string access_token
{
get { return _access_token; }
set { _access_token = value; }
}
 
 
///
 
 
/// 憑證有效時間,單位:秒
///
 
public string expires_in
{
get { return _expires_in; }
 
 
set { _expires_in = value; }
}
 
}
 public ActionResult index(string returnUrl)
{
 
GetAccess_token();
 
IsExistAccess_Token();
 
return View();
}
 
 
 
public static Access_token GetAccess_token()
{
string AppUrl = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?";
string AppID = "應(yīng)用組的CorpID";//在設(shè)置-》權(quán)限管理-》系統(tǒng)管理組
string AppSecret = "應(yīng)用組的Secret";//在設(shè)置-》權(quán)限管理-》系統(tǒng)管理組
WebClient webClient = new WebClient();
Byte[] bytes = webClient.DownloadData(string.Format("{0}corpid={1}&corpsecret={2}", AppUrl, AppID, AppSecret));
string result = Encoding.GetEncoding("utf-8").GetString(bytes);
JObject jObj = JObject.Parse(result);
 
string token = jObj["access_token"].ToString();
string expires_in = jObj["expires_in"].ToString();
 
Access_token mode = new Access_token();
mode.access_token = token;
mode.expires_in = expires_in;
return mode;
}
 
///

?? ??? ???? Access_Token? ?????? ?????. ???? ? Access_Token? ???? ??? ??? ?? Access_Token? ?????.

public static string IsExistAccess_Token()
{
string Token = string.Empty;
DateTime YouXRQ;
string strPath = "../../weixin/XMLFile.xml";
// 讀取XML文件中的數(shù)據(jù),并顯示出來
//string filepath = System.Web.Hosting.HostingEnvironment.MapPath(strPath);
string filepath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, strPath);
 
StreamReader str = new StreamReader(filepath, System.Text.Encoding.UTF8);
XmlDocument xml = new XmlDocument();
xml.Load(str);
str.Close();
str.Dispose();
Token = xml.SelectSingleNode("xml").SelectSingleNode("Access_Token").InnerText;
YouXRQ = Convert.ToDateTime(xml.SelectSingleNode("xml").SelectSingleNode("Access_YouXRQ").InnerText);
 
 
if (DateTime.Now > YouXRQ)
{
DateTime _youxrq = DateTime.Now;
Access_token mode = GetAccess_token();
xml.SelectSingleNode("xml").SelectSingleNode("Access_Token").InnerText = mode.access_token;
_youxrq = _youxrq.AddSeconds(int.Parse(mode.expires_in));
xml.SelectSingleNode("xml").SelectSingleNode("Access_YouXRQ").InnerText = _youxrq.ToString();
xml.Save(filepath);
Token = mode.access_token;
}
 
object text = new
{
toparty = "1",
agentid = "2",
msgtype = "text",
text = new
{
content = "項目名稱:"+來保網(wǎng)+""
}
};
 
string wcr= btnSend(Token, text);
return wcr;
 
}
public static string btnSend(string Token, object text)
{
 
string url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" + Token;
WebRequest req = WebRequest.Create(url);
JavaScriptSerializer aa = new JavaScriptSerializer();
string postData = aa.Serialize(text);
byte[] requestBytes = Encoding.UTF8.GetBytes(postData);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = requestBytes.Length;
 
Stream requestStream = req.GetRequestStream();
requestStream.Write(requestBytes, 0, requestBytes.Length);
requestStream.Close();
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream(), Encoding.Default);
string backstr = sr.ReadToEnd();
sr.Close();
res.Close();
WeChatReturn WCR = aa.Deserialize(backstr);
return WCR.errmsg;
 
}

?? ??? ?????. ???? ??? ??? ????. ?????. ? ???? ??? ??? ?????!

?? ??:

WebSocket ?? WEB ??? ?? ?????

.NET WeChat ?? ?? ??? ?? ?? ??

Java?? websocket? ?? ??? ?? ?? ??? ?? ??? ??

? ??? WeChat ?? ??? ?? ?? ??(?? ??)? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1597
29
PHP ????
1488
72
???