QiFeng.ZWY.Bll/WxInterfaceFunc/WxInterMsgFunc.cs
(开头部分) 29KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
using log4net;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Model.WeChat;
using QiFeng.LMSD.Utility;
using Newtonsoft.Json;
namespace QiFeng.LMSD.Bll.WxInterfaceFunc
{
/// <summary>
/// 微信消息接口类
/// </summary>
public class WxInterMsgFunc : BaseWxInterFunc
{
private readonly ILog _fileLog = LogManager.GetLogger(typeof(WxInterMsgFunc));
/// <summary>
/// 发送图文消息
/// </summary>
/// <param name="wechatInfo"></param>
/// <param name="toUserName"></param>
/// <param name="lsArticles"></param>
/// <returns></returns>
public string SendWxTxtPic(WechatInfo wechatInfo, string toUserName, List<Article> lsArticles)
{
if (lsArticles == null || lsArticles.Count <= 0)
{
return string.Empty;
}
var msgTxtPic = new WechatMsgSentTxtPic
{
ToUserName = toUserName,
FromUserName = wechatInfo.WechatId,
CreateTime = FormatToWxTime(DateTime.Now),
MsgType = "news",
ArticleCount = lsArticles.Count,
Articles = lsArticles
};
var sbSendContent = new StringBuilder();
sbSendContent.Append("<xml>");
sbSendContent.Append("<ToUserName><![CDATA[");
sbSendContent.Append(toUserName);
sbSendContent.Append("]]></ToUserName>");
sbSendContent.Append("<FromUserName><![CDATA[");
sbSendContent.Append(msgTxtPic.FromUserName);
sbSendContent.Append("]]></FromUserName>");
sbSendContent.Append("<CreateTime>");
sbSendContent.Append(msgTxtPic.CreateTime.ToString(CultureInfo.InvariantCulture));
sbSendContent.Append("</CreateTime>");
sbSendContent.Append("<MsgType><![CDATA[");
后面还有 642 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。