? ??? WeChat?? ??? WeChat ?? ???? ?? ?????
1. ?? ??? ??? ??(??????)? ??? ?? ?? ???? ???? ??? ???? ??? ??? ?????. ?? ??: http://mp.weixin.qq.com/wiki/home/index.html
??, ???? appid ? appsecret? ??? ?? ????? ????? ???? ?? ?? ?????? ???? access_token? ?????.
2. ?? ??? ?? ?? ? ?? ??? ??? ?? ??? ??????? ?? ??? ?? ???? ?????. ??
(1) ?? ??, http ??
///?<summary> ????????///??????http??get/post?公用方法 ????????///?</summary> ????????///?<param name="requestUrl">請求鏈接</param> ????????///?<param name="requestJsonParams">請求參數(shù)值(如果是get方式此處為“”值,默認為?"")</param> ????????///?<param name="requestMethod">請求方式??post?or?get</param> ????????///?<returns></returns> ????????public?static?string?Request(this?string?requestUrl,?string?requestMethod,?string?requestJsonParams?=?"") ????????{ ????????????string?returnText?=?""; ????????????StreamReader?streamReader?=?null; ????????????HttpWebRequest?request?=?null; ????????????HttpWebResponse?response?=?null; ????????????Encoding?encoding?=?Encoding.UTF8; ????????????request?=?(HttpWebRequest)WebRequest.Create(requestUrl); ????????????request.Method?=?requestMethod; ????????????if?(!string.IsNullOrEmpty(requestJsonParams)?&&?requestMethod.ToLower()?==?"post") ????????????{ ????????????????byte[]?buffer?=?encoding.GetBytes(requestJsonParams); ????????????????request.ContentLength?=?buffer.Length; ????????????????request.GetRequestStream().Write(buffer,?0,?buffer.Length); ????????????} ????????????try ????????????{ ????????????????response?=?(HttpWebResponse)request.GetResponse(); ????????????????using?(streamReader?=?new?StreamReader(response.GetResponseStream(),?System.Text.Encoding.GetEncoding("gb2312")))//utf-8 ????????????????{ ????????????????????returnText?=?streamReader.ReadToEnd(); ????????????????} ????????????} ????????????catch?(Exception?ex) ????????????{ ????????????????returnText?=?ex.Message; ????????????} ????????????return?returnText; ????????}
(2) ????? ??:
///?<summary> ????????///?????發(fā)送微信信息(單用戶發(fā)送) ????????///?</summary> ????????///?<param name="access_token">授權碼(微信token)</param> ????????///?<param name="messageInfo">發(fā)送信息模型</param> ????????///?<returns></returns> ????????public?static?string?SendSingleMessage(WeChatParamEntity?messageInfo,?string?access_token) ????????{ ????????????messageInfo.MsgType?=?string.IsNullOrEmpty(messageInfo.MsgType)???"text"?:?messageInfo.MsgType; ????????????string?jsonDataParams?=?messageInfo?==?null???""?:?JsonConvert.SerializeObject(new ????????????{ ????????????????touser?=?messageInfo.ToUser, ????????????????msgtype?=?messageInfo.MsgType, ????????????????text?=?new?{?content?=?messageInfo.Text?} ????????????}); ????????????string?requestUrl?=?string.Format(Consts.URL_POSTSINGLETEXTMESSAGE,?access_token); ????????????return?requestUrl.Request("POST",?jsonDataParams); ????????} ????????///?<summary> ????????///?????發(fā)送微信信息(多用戶批量發(fā)送) ????????///?</summary> ????????///?<param name="access_token">授權碼(微信token)</param> ????????///?<param name="messageInfo">發(fā)送信息模型</param> ????????///?<returns></returns> ????????public?static?string?SendMessages(WeChatParamsEntity?messageInfo,?string?access_token) ????????{ ????????????messageInfo.MsgType?=?string.IsNullOrEmpty(messageInfo.MsgType)???"text"?:?messageInfo.MsgType; ????????????string?jsonDataParams?=?messageInfo?==?null???""?:?JsonConvert.SerializeObject(new ????????????{ ????????????????touser?=?messageInfo.ToUser, ????????????????msgtype?=?messageInfo.MsgType, ????????????????text?=?new?{?content?=?messageInfo.Text?} ????????????}); ????????????string?requestUrl?=?string.Format(Consts.URL_POSTTEXTMESSAGES,?access_token); ????????????return?requestUrl.Request("POST",?jsonDataParams); ????????}
(3) ? ?? ???? ??:
///?<summary> ????///?????微信?發(fā)送信息?參數(shù)實體模型 ????///?</summary> ????public?class?WeChatParamEntity ????{ ????????///?<summary> ????????///?????普通用戶openid ????????///?</summary> ????????public?string?ToUser?{?get;?set;?} ????????///?<summary> ????????///?????傳輸?shù)奈募愋停╰ext,image,?and?so?on) ????????///?</summary> ????????public?string?MsgType?{?get;?set;?}?=?"text"; ????????///?<summary> ????????///?????傳輸文本內容 ????????///?</summary> ????????public?string?Text?{?get;?set;?} ????} ????///?<summary> ????///?????微信?發(fā)送信息?參數(shù)實體模型 ????///?</summary> ????public?class?WeChatParamsEntity ????{ ????????///?<summary> ????????///?????普通用戶openid ????????///?</summary> ????????public?string[]?ToUser?{?get;?set;?} ????????///?<summary> ????????///?????傳輸?shù)奈募愋停╰ext,image,?and?so?on) ????????///?</summary> ????????public?string?MsgType?{?get;?set;?}?=?"text"; ????????///?<summary> ????????///?????傳輸文本內容 ????????///?</summary> ????????public?string?Text?{?get;?set;?} ????}
(4) web.config? ??
<!--微信接口--> ????<add key="appid" value="wx123456789021"/> ????<add key="appSecret" value="adasdsadasdasdsadasdsaqweqw"/> ????<add key="getAccessTokenUrl" value="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}"/> ????<!--單用戶信息發(fā)送--> ????<add key="postSingleTextMessageUrl" value="https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={0}"/> ????<!--多用戶批量發(fā)送--> ????<add key="postTextMessagesUrl" value="https://api.weixin.qq.com/cgi-bin/message/mass/send?access_token={0}"/> ????<!--\微信接口-->
3. ?????? ???? ?? ??? openID? touser? ??? ? ?? ??? ?????. ?? ?? ?????. >
??? ??? appid ? appsecret(?, ?? 2??) ?? ?? ??? ??? QR ??? ????. ?? WeChat?? ???? ???? openID? ?? ? ????. ??? ???? ????? ???? ????? ???? ??? ??: ??? ??? json ???? ?? ?? 3: ??? ?????. 7200? ?? ?? ??? ??? ???? ?? ???? ???? ?? ?????. ??? ?? ?? ?? ?? 2000???.?? ????:????
? ??? WeChat ?? WeChat?? ??? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

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

PHP? ? ?? ? ?? ? ?????, ?? WeChat ??? ?? ???? ?? ?? ???? ?????. ??? ?? ? ?? ??? ???? WeChat ??? PHP? ???? ???? ????. PHP? ??? ?? ???? ?? ?? ???? ?????. WeChat ???? ??? ??? ? ???? ??? ??? ???? ?? ??? ?? ??? ?????. ??? ? ??? ??? ?? ???? ?? ??? ?? ???? ??? ? ?? ????? ??? ? ? ????.

WeChat ?? ??? ??? ? ?? ??? ?? ?????. ?? ??? ????? ?? ??? ??? ??? ? ?? ?? ????, ??? ?? ? ?? ??? ?? ??? ????? ???. ? ????? PHP? ???? WeChat ?? ??? ???? ??? ?????. WeChat ?? ?? ??? ???? ?? WeChat ?? ?? ??? ??? ???. WeChat ?? ?????? WeChat ?? ??, ?? ?? ? ?? ??? ???? ??? API ??? ???? ???. PHP ??? ???? ???? ???? WeChat?? ????? ???? PH? ???? ???.

WeChat? ??? ?? ?? ? ?? ??? WeChat? ??? ??? ???? ??????. WeChat ?? ??? ??? ??? WeChat ???? ???? ??? ?? ? ?????. ??? ?? ???? ????? ??? ?????? ?? ??? ?? ??? ?? ?????. ??? WeChat ?? ??? ??? ???? ?? ?? ?????. ? ????? PHP? ???? WeChat ?? ??? ??? ???? ??? ?????. 1. ?? ?? WeChat ?? ??? ??? ????? ?? ?? ??? ???? ???. PHP WeChat ?? ??? ??? ?? ?? ?? ?? ??: Sub

WeChat? ?? ???? ?? ? ??? ??? ??? ?? ??? ? ?????. ??? ???? ??? ?? ?? ? ?? ???? WeChat ???? ???? ??? ??????. WeChat ???? ??? ? ?? ???? ??? ?????. ?? ??? ?? ?? ? ? ???? ?? WeChat ??? PHP ??? ??? ? ????. 1. PHP ?? WeChat ?? PHP? ? ?? ???? ?? ???? ?? ?? ?? ? ???? ?????. WeChat ?? ????? ???? ?? ?????? ???? PHP ??? ???? WeChat? ??? ? ????.

WeChat ?? ?? ???? ??? ?? ??? ???? ???? ? ? ???? ??? ? ??? ?? ?? ??? ?????. ? ????? PHP? ???? WeChat ??? ?? ?? ??? ???? ??? ?????. 1. WeChat ???? openid? ?????. WeChat ??? ?? ?? ??? ???? ?? ?? ???? openid? ???? ???. WeChat ?? ??? ??? ? ??? ??? ?? openid? ?? ?? ???? ?????. ??? ??? ???? ?? ??? ?? ???? ?? ? ????.

WeChat? ???? ??? ?? ? ??? ?????? ??? ???, WeChat? ??? ??? ??? ?? ??? ??? ??? ??? ?? ????. ??? ?? WeChat? ??? ????? ???? ?? ??? ??? ???? WeChat ??? ???? ?? ?? ???? ????. ? ? ?? ?? ??? ?? ?? ?????. ???? PHP ??????? ?? ??? ?? ??? ??? ???? ???? ??? ??? ?????. 1. WeChat ?? ??? ??? ?? ??? ?????. ?? ??? ?? ??? ???? ??? ?????.

PHP? ???? WeChat ?? ??? ???? ?? WeChat ?? ??? ?? ??? ?? ? ?? ??? ?? ??? ??? ????, ????? ???? ? ??? PHP? ???? WeChat ?? ??? ??? ?? ????. ? ????? PHP? ???? WeChat ?? ??? ???? ???? ??? ?????. 1??: WeChat ?? ??? ??? ??? ????. WeChat ?? ?? ??? ???? ?? WeChat ?? ??? ??? ??? ???? ???. ???? ?? ??? WeChat ?? ??? ?? ????? ?????.

???? ??? ??? ??? ???? WeChat? ?? ? ??? ???? ???? ?? ??? ?????. ?? ? ?????? ??? WeChat ??? PHP? ???? ??? ?? ???? ??? ?????. ? ????? ?? WeChat ??? PHP? ???? ??? ?? ?? ?? ???? ?? ? ? ?? ??? ?????. 1. ?? ?? ?? WeChat? ???? ?? ?? ?? ?? ??? ???? ???. ??, PHP ?? ??? WeChat ?? ???? ???? ???.
