private static void ProduceImage(Dictionary<string, string> model) { SendImage text = new SendImage(); text.ToUserName = model.ReadKey(PublicField.FromUserName); text.FromUserName = model.ReadKey(PublicField.ToUserName); text.CreateTime = int.Parse(model.ReadKey(PublicField.CreateTime)); text.MsgType = "image"; }
/// <summary> /// 回复图片消息的函数 /// </summary> /// <param name="model">The model.</param> /// <param name="mediaId">服务器上图片的ID</param> /// Author : 俞立钢 /// Company : 绍兴标点电子技术有限公司 /// Created : 2014-10-24 10:23:10 private static void ProduceImage(Dictionary<string, string> model,int mediaId) { SendImage image = new SendImage(); image.ToUserName = model.ReadKey(PublicField.FromUserName); image.FromUserName = model.ReadKey(PublicField.ToUserName); image.CreateTime = int.Parse(model.ReadKey(PublicField.CreateTime)); image.MsgType = "image"; image.MediaId = mediaId; OperateXml.ResponseEnd(Templete.SendImg(image)); }
/// <summary> /// 回复图片消息 /// </summary> /// <param name="model">The model.</param> /// Author : 俞立钢 /// Company : 绍兴标点电子技术有限公司 /// Created : 2014-10-10 11:00:22 public static string SendImg(SendImage model) { return string.Format(@"<xml> <ToUserName><![CDATA[{0}]]></ToUserName> <FromUserName><![CDATA[{1}]]></FromUserName> <CreateTime>{2}</CreateTime> <MsgType><![CDATA[{3}]]></MsgType> <Image> <MediaId><![CDATA[{4}]]></MediaId> </Image> </xml>", model.ToUserName, model.FromUserName, model.CreateTime, model.MsgType, model.MediaId); }