FWQ
详解微信公众平台开发之发送文本消息.Net代码解析方法
这篇文章详解微信公众平台开发之发送文本消息.net代码解析方法 .Net实现微信公共服务平台开发中的发送文本消息功能,具体内容如下 首先建立一个微信消息类。 class wxmessage { public string FromUserName { get; set; } public string ToUserName { get; set; } public string MsgType { get; set; } public string EventName { get; set; } public string Content { get; set; } public string EventKey { get; set; } } 登录后复制 后台代码如下: protected void Page_Load(object sender, EventArgs e) { wxmessage wx = GetWxMessage(); string res = ""; if (!string.IsNullOrEmpty(wx.EventName) && wx.EventName.Trim() == "subscribe") {//刚关注时的时间,用于欢迎词 string content = ""; content = "/:rose欢迎北京永杰友信科技有限公司/:rose 直接回复“你好”"; res = sendTextMessage(wx, content); } else {…