Example #1
0
        static void Main(string[] args)
        {
            CorpSendBase.Send("text 1234", touser: "******", msgType: MsgType.text);
            CorpSendBase.Send("D:\\Demo\\MyServiceLog.txt", "YuanHuiHui", msgType: MsgType.file);
            CorpSendBase.Send("C:\\Users\\yuanhh\\Desktop\\微信图片_20190520134904.png", "YuanHuiHui", msgType: MsgType.image);
            CorpSendBase.Send("C:\\Users\\yuanhh\\Desktop\\VQLC0849.MP4", "YuanHuiHui", msgType: MsgType.video);
            news news = new news()
            {
                articles = new List <articles>()
                {
                    new articles()
                    {
                        title       = "端午浓情,粽相随",
                        description = "集团消息,祝端午节快乐,",
                        picurl      = "http://b.hiphotos.baidu.com/image/pic/item/9825bc315c6034a8ef5250cec5134954082376c9.jpg",
                        url         = "www.baidu.com",
                    }
                },
            };

            CorpSendBase.Send(news, touser: "******", msgType: MsgType.news);
            var textCard = new textcard()
            {
                btntxt      = "更多",
                description = "<div class=\"gray\">2016年9月26日</div> <div class=\"normal\">恭喜你抽中iPhone 7一台,领奖码:xxxx</div><div class=\"highlight\">请于2016年10月10日前联系行政同事领取</div>",
                title       = "恭喜你抽中iPhone 7一台",
                url         = "www.baidu.com"
            };

            CorpSendBase.Send(textCard, touser: "******", msgType: MsgType.textcard);
            Console.ReadKey();
        }
Example #2
0
 public static RedisCache GetClient()
 {
     try
     {
         lock (locker)
         {
             if (Redis == null)
             {
                 Redis = new RedisCache();
             }
         }
     }
     catch (Exception ex)
     {
         CorpSendBase.CreateLog("RedisCache初始化错误!" + ex.Message);
     }
     return(Redis);
 }