Пример #1
0
        /// <summary>
        /// 获取异步结果
        /// </summary>
        /// <param name="media_id"></param>
        /// <param name="access_token"></param>
        /// <returns></returns>
        public static string Getresult(string jobid, string access_token)
        {
            string          url             = "https://qyapi.weixin.qq.com/cgi-bin/batch/getresult?access_token=" + access_token + "&jobid=" + jobid;
            HttpWebResponse httpWebResponse = HttpWebResponseUtility.CreateGetHttpResponse(url, 1000000, "", null);
            Stream          responseStream  = httpWebResponse.GetResponseStream();
            StreamReader    streamReader    = new StreamReader(responseStream, Encoding.Default);
            string          json            = streamReader.ReadToEnd();

            return(json);
        }
Пример #2
0
        /// <summary>
        /// 增量人员
        /// </summary>
        /// <param name="media_id"></param>
        /// <param name="access_token"></param>
        /// <returns></returns>
        public static Hashtable UpdateConvertMember(string media_id, string access_token)
        {
            Hashtable hashtable = new Hashtable();

            hashtable["media_id"] = media_id;
            string          parameters      = JSON.Encode(hashtable);
            string          url             = "https://qyapi.weixin.qq.com/cgi-bin/batch/syncuser?access_token=" + access_token;
            HttpWebResponse httpWebResponse = HttpWebResponseUtility.CreatePostHttpResponse(url, parameters, null, null, Encoding.UTF8, null);
            Stream          responseStream  = httpWebResponse.GetResponseStream();
            StreamReader    streamReader    = new StreamReader(responseStream, Encoding.Default);
            string          json            = streamReader.ReadToEnd();

            return((Hashtable)JSON.Decode(json));
        }