接收消息和发送消息开发流程和注意事项1.⾸先进⾏基本配置:
王志文老婆是谁<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>
注意:常规的Request是获取不到消息的,我在⽹上查到的⽅式如下:
public string PostInput(System.Web.HttpRequest request)
{
try
{
return PostInput(request, Encoding.UTF8);
}
catch (Exception ex)
{ throw ex; }
}
public string PostInput(System.Web.HttpRequest request, Encoding encoding)      {
StringBuilder builder = new StringBuilder();
try董文华自杀
{
using (System.IO.Stream s = request.InputStream)
{
int count = 0;
林志颖年龄
王骏迪个人资料byte[] buffer = new byte[1024];
while ((count = s.Read(buffer, 0, 1024)) > 0)
{
builder.Append(encoding.GetString(buffer, 0, count));
}
s.Flush();
s.Close();
s.Dispose();
山田斗真
}
return builder.ToString();
聘任书格式}
catch (Exception ex)
{ throw ex; }
}
注意:输出之前先要Response.Clear(),否则可能由于缓存原因不输出内容.