private void btnTestSend_Click(object sender, EventArgs e) { var wx = new WeChat(); var msg = wx.SendMessage("kyezuo", "测试消息,有程序停止运行了,赶紧处理!"); MessageBox.Show(msg["errmsg"].ToString()); }
public static void SendNoticeWeiXin(ProgramInfo programInfo) { if (string.IsNullOrEmpty(NoticeWxUserIds)) return; string msg = string.Format("程序名:{0},版本:{1},安装路径:{2},已停止运行了,请尽快处理!", programInfo.Name, programInfo.Version, programInfo.InstalledLocation); var wx = new WeChat(); var result = wx.SendMessage(NoticeWxUserIds, msg); if (result["errmsg"].ToString().Equals("ok", StringComparison.OrdinalIgnoreCase)) { WriteLog(string.Format("程序名:{0},版本:{1},已停止运行超过5分钟,成功发送微信通知到:{2}", programInfo.Name, programInfo.Version, NoticeWxUserIds), false); } }