Exemple #1
0
        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 WxOpenInfo(string p_code)
        {
            Code = p_code;
            string _openstr = AtWeb.GetWxOpenid(p_code);

            if (string.IsNullOrEmpty(_openstr))
            {
                return;
            }
            _openstr = _openstr.Replace("{", "").Replace("}", "").Replace("\"", "");
            string[] _vals = _openstr.Split(',');
            Session_Key = _vals[0].Split(':')[1];
            OpenId      = _vals[1].Split(':')[1];
        }
Exemple #3
0
 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())));
 }