public static bool DownloadMediaFileT(ReceiveMessageBase rmb) { if (rmb is VoiceReceiveMessage) { try { VoiceReceiveMessage _vrm = rmb as VoiceReceiveMessage; Logger.WriteTxtLog(_vrm.MediaId + "|" + WxAccToken.AccessTokenStr); string _url = string.Format("http://apple1302.gicp.net/WxService/FileHandler.ashx?type=voice&MediaId={0}&AccessToken={1}&FromUserName={2}", _vrm.MediaId, WxAccToken.AccessTokenStr, _vrm.FromUserName); string _val = AtWeb.Get(_url); DateTime _now = DateTime.Now; string fileName = System.AppDomain.CurrentDomain.BaseDirectory; if (!fileName.EndsWith("\\")) { fileName += "\\"; } fileName += "WxVoice\\"; string mp3 = _now.ToString("yyyyMMddHHmmss") + ".mp3"; fileName += mp3; SchoolData.语音记录(mp3); FileIO _fio = new FileIO(); _fio.OpenWriteFile(fileName); _fio.WriteLine(_val); _fio.CloseWriteFile(); } catch { } } return(true); }
public override string GetResult(HttpContext context) { base.GetResult(context); return(AtWeb.Get(HttpUtility.UrlDecode("http://apple1302.gicp.net/HisInfo/GetHisInfo.ashx?" + context.Request.QueryString.ToString()))); }