国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ?? ??? ?? ?? C# WeChat ?? ??? - ?? ??? ??/??

C# WeChat ?? ??? - ?? ??? ??/??

Mar 03, 2017 am 09:24 AM

4.0 ?? ??/??

①?? ??/?? ?? ??

?? WeChat ???? ???? ???? ?? ? ?? ?? ?? WeChat ??? ???? ??? URL? POST ???? XML ??? ??? ????. ??? ???? ?? WeChat ?? ????? ?? ???? ????? WeChat ?? ??? ???? ??? ?????. WeChat? ??? ?? ????(?? ??? ??? ?? WeChat ?? ??)? ?? ?? ?? ???? ??? ???.

??:


1. msgid ?? ??? ???? ?? ????.

2. WeChat ??? 5? ??? ??? ?? ??? ??? ?? ??? ?? ???? ? 3?? ?? ?????. ??? 5? ??? ?? ? ??? ??? ? ?? ?? ? ???? ?? ??? ? ????. WeChat ??? ?? ?? ?? ??? ???? ??? ???? ???? ????. ??? ??? "??? ??? - ???? ?? ??"? ?????.

3. ? ?? ??? ???? ?? ???? ?? ??? ?? ????? ??? ???? ??? ???? ??? ? ????. ???? ???? ??? ???? ?? ???? ?????, ?? ???? ????? ????? ??? ???? ?????? ???. (?, ?? ??? ?????? ?? API ??? ?? ????? ???? ??? ???? ??? ?? ????.) ??? ??? ? ?? ??? ?? ??? ??? "??? ??? ? ?? ?? ??"? ?????.

??? ??? ?? POST? XML ??? ??? ????.


?<xml>
?<ToUserName><![CDATA[toUser]]></ToUserName>
?<FromUserName><![CDATA[fromUser]]></FromUserName>?
?<CreateTime>1348831860</CreateTime>
?<MsgType><![CDATA[text]]></MsgType>
?<Content><![CDATA[this is a test]]></Content>
?<MsgId>1234567890123456</MsgId>
?</xml>


?? ??? ?? ???? ??:

C#微信開(kāi)發(fā)系列-接收 / 返回文本消息

?? ???? XML ??? ?????.


<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[你好]]></Content>
</xml>

?? ??? ?? ????? ?????. ?? :

C#微信開(kāi)發(fā)系列-接收 / 返回文本消息

②?? ??? ??/?? ?? ??

???? ?? ???? WeChat? ????. ??? ??? XML ??? ??? ???? ?? ??? ??? ????:

if(IsPostBack)
{ 
  //*********************************自動(dòng)應(yīng)答代碼塊*********************************
  string postString = string.Empty;
  using (Stream stream = HttpContext.Current.Request.InputStream)
  {
    Byte[] postBytes = new Byte[stream.Length];
    stream.Read(postBytes, 0, (Int32)stream.Length);
    //接收的消息為GBK格式
    postString = Encoding.GetEncoding("GBK").GetString(postBytes);
    string responseContent = help.ReturnMessage(postString );
    //返回的消息為UTF-8格式
    HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;
    HttpContext.Current.Response.Write(responseContent);
  }
  //********************************自動(dòng)應(yīng)答代碼塊end*******************************
}

??: ???? ??? ? ??? ??? "GBK" ???? ???? ???. ??? ??? ?? ?? ? ????? ?? ???? ????. ???? ???.

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

/// <summary>
/// 統(tǒng)一全局返回消息處理方法
/// </summary>
/// <param name="postStr"></param>
/// <returns></returns>
public string ReturnMessage(string postStr)
{
  string responseContent = "";
  XmlDocument xmldoc = new XmlDocument();
  xmldoc.Load(new System.IO.MemoryStream(System.Text.Encoding.GetEncoding("GB2312").GetBytes(postStr)));
  XmlNode MsgType = xmldoc.SelectSingleNode("/xml/MsgType");
  if (MsgType != null)
  {
    switch (MsgType.InnerText)
    {
      case "event":
        responseContent = EventHandle(xmldoc);//菜單事件處理
        break;
      case "text":
        responseContent = TextHandle(xmldoc);//文本消息處理
        break;
      default:
        break;
   }
  }
  return responseContent;
}

TextHandle(xmldoc) ?? ??? ??? ??? ????.

/// <summary>
/// 接受文本消息并回復(fù)自定義消息
/// </summary>
/// <param name="xmldoc"></param>
/// <returns></returns>
public string TextHandle(XmlDocument xmldoc)
{
 string responseContent = "";
 XmlNode ToUserName = xmldoc.SelectSingleNode("/xml/ToUserName");
 XmlNode FromUserName = xmldoc.SelectSingleNode("/xml/FromUserName");
 XmlNode Content = xmldoc.SelectSingleNode("/xml/Content");
 if (Content != null)
 {
   if (Content.InnerText == "指定回復(fù)消息的自定義文本")
   {
     responseContent = string.Format(XMLTemplate.Message_Text,
       FromUserName.InnerText,
       ToUserName.InnerText,
       DateTime.Now.Ticks,
       "自定義回復(fù)消息內(nèi)容");
   }
 }
 return responseContent;
}

??? ??? ???? ?? ??? ??? ????. ??? ?? ??? ? ??? ???? ?? ?????. ?? ?? ?? ???, ?? ???, ?? ???, ?? ???, ?? ?? ???, ??? ?? ???, ?? ??? ?? ??/?????. ?? ??? ???? ?? ??? ? ????.

? ?? C# 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)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???