Beispiel #1
0
        public void SetMsg(string OpenId, string Msg)
        {
            string param = "{\"touser\":\"" + OpenId + "\",\"msgtype\":\"text\",\"text\":{\"content\":\"" + Msg + "\"}}";
            string url   = string.Format("https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={0}", GetToken());

            Submit.HttpPost(url, param);
        }
Beispiel #2
0
        public void UpdateMenu()
        {
            string param = "{\"button\":[{\"type\":\"view\",\"name\":\"云推送\",\"url\":\"http://v.icoxtech.com\"},"
                           + "{\"name\":\"我的设备\",\"sub_button\":[{\"type\":\"view\",\"name\":\"设备管理\",\"url\":\"http://v.icoxtech.com/Child/EjqDeviceList.aspx\"}," +
                           "{\"type\":\"view\",\"name\":\"成员管理\",\"url\":\"http://v.icoxtech.com/Child/EjqUsers.aspx\"}]},"
                           + "{\"name\":\"远程管理\",\"sub_button\":[{\"type\":\"click\",\"name\":\"一键抓拍\",\"key\":\"V1003_GOOD\"},{\"type\":\"click\",\"name\":\"视频抓拍\",\"key\":\"V1001_GOOD\"}," +
                           "{\"type\":\"click\",\"name\":\"远程定位\",\"key\":\"V1002_GOOD\"},{\"type\":\"view\",\"name\":\"习惯养成\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0299348550ae02ce&redirect_uri=http://v.icoxtech.com/AlarmClock.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect\"}]}]}";//{\"type\":\"click\",\"name\":\"我的设备\",\"key\":\"T12\"},{\"type\":\"view\",\"name\":\"最新资源\",\"url\":\"http://v.icoxtech.com?a=-1\"}]}";
            string url = string.Format("https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}", GetToken());

            Write(Submit.HttpPost(url, param));
        }
Beispiel #3
0
        public void UpdateMenu()
        {
            string str = "{\"button\":[{\"type\":\"view\",\"name\":\"名师课堂\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf9ade153117809bf&redirect_uri=http://ftv.icoxtech.com&response_type=code&scope=snsapi_base&state=1#wechat_redirect\"},"
                         + "{\"name\":\"亲子互动\",\"sub_button\":[{\"type\":\"click\",\"name\":\"一键解锁\",\"key\":\"V1006_GOOD\"},{\"type\":\"click\",\"name\":\"一键锁屏\",\"key\":\"V1005_GOOD\"},{\"type\":\"click\",\"name\":\"远程定位\",\"key\":\"V1002_GOOD\"},{\"type\":\"view\",\"name\":\"习惯养成\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf9ade153117809bf&redirect_uri=http://v.icoxtech.com/AlarmClock.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect\"},{\"type\":\"view\",\"name\":\"使用轨迹\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf9ade153117809bf&redirect_uri=http://v.icoxtech.com/StudyStation.aspx&response_type=code&scope=snsapi_base&state=1#wechat_redirect\"}]},"
                         + "{\"name\":\"远程管理\",\"sub_button\":[{\"type\":\"click\",\"name\":\"一键抓拍\",\"key\":\"V1003_GOOD\"},{\"type\":\"click\",\"name\":\"视频抓拍\",\"key\":\"V1001_GOOD\"}," +
                         "{\"type\":\"view\",\"name\":\"设备管理\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf9ade153117809bf&redirect_uri=http://v.icoxtech.com/Child/ChildDeviceList.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect\"}," +
                         "{\"type\":\"view\",\"name\":\"成员管理\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf9ade153117809bf&redirect_uri=http://v.icoxtech.com/Child/ChildUsers.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect\"}]}]}";
            string url = string.Format("https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}", GetToken());

            Write(Submit.HttpPost(url, str));
        }
Beispiel #4
0
        //更改菜单
        public void UpdateMenu()
        {
            //string studyUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0e7b25b6f1553eea&redirect_uri=http://v.icoxtech.com/StudyStation.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect";
            //{"button": [{"type": "view", "name": "云推送", "url": "http://v.icoxtech.com/IndexPage.aspx"}, {"name": "亲子互动", "sub_button": [{"type": "view", "name": "一键锁屏", "url": "http://www.soso.com"}, {"type": "view", "name": "作息管理", "url": "http://v.qq.com"}, {"type": "click", "name": "学习情况", "key": "V1001_GOOD"}]}, {"type": "view", "name": "最新资源", "url": "http://v.icoxtech.com?a=-1"}]}
            string param = "{\"button\":[{\"type\":\"view\",\"name\":\"云推送\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0e7b25b6f1553eea&redirect_uri=http://v.icoxtech.com/Child/ChildIndex.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect\"},"
                           + "{\"name\":\"亲子互动\",\"sub_button\":[{\"type\":\"click\",\"name\":\"一键解锁\",\"key\":\"V1006_GOOD\"},{\"type\":\"click\",\"name\":\"一键锁屏\",\"key\":\"V1005_GOOD\"},{\"type\":\"click\",\"name\":\"远程定位\",\"key\":\"V1002_GOOD\"},{\"type\":\"view\",\"name\":\"作息管理\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0e7b25b6f1553eea&redirect_uri=http://v.icoxtech.com/AlarmClock.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect\"},{\"type\":\"view\",\"name\":\"使用轨迹\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0e7b25b6f1553eea&redirect_uri=http://v.icoxtech.com/StudyStation.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect\"}]},"
                           + "{\"name\":\"远程管理\",\"sub_button\":[{\"type\":\"click\",\"name\":\"一键截图\",\"key\":\"V1004_GOOD\"},{\"type\":\"click\",\"name\":\"一键抓拍\",\"key\":\"V1003_GOOD\"},{\"type\":\"click\",\"name\":\"视频抓拍\",\"key\":\"V1001_GOOD\"}," +
                           "{\"type\":\"view\",\"name\":\"设备管理\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0e7b25b6f1553eea&redirect_uri=http://v.icoxtech.com/Child/ChildDeviceList.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect\"}," +
                           "{\"type\":\"view\",\"name\":\"成员管理\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0e7b25b6f1553eea&redirect_uri=http://v.icoxtech.com/Child/ChildUsers.aspx?response_type=code&scope=snsapi_base&state=1#wechat_redirect\"}]}]}";
            string url = string.Format("https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}", GetChildToken());

            Write(Submit.HttpPost(url, param));
        }
Beispiel #5
0
        /// <summary>
        /// 根据场景ID获取ticket
        /// </summary>
        /// <param name="sceneID">场景ID</param>
        /// <returns></returns>
        private static string GetTicket(string token, int sceneID)
        {
            WriteLog("GetTicket");
            if (sceneID < 1 && sceneID > 100000)
            {
                return(null);
            }
            string data      = string.Format(TEMP_JSON_DATA, sceneID.ToString());
            string returnStr = Submit.HttpPost(string.Format(GET_TICKET_URL, token), data);
            JavaScriptSerializer        serializer = new JavaScriptSerializer();
            Dictionary <string, object> dic        = (Dictionary <string, object>)serializer.DeserializeObject(returnStr);

            return(dic["ticket"] + "");
        }
Beispiel #6
0
        public static string PushMsg(string token, string str)
        {
            Dictionary <string, object> parasDic = new Dictionary <string, object>();

            parasDic.Add("access_id", ACCESSID);
            parasDic.Add("timestamp", GetTimeStamp());
            parasDic.Add("message_type", 2);
            parasDic.Add("device_token", token);
            parasDic.Add("expire_time", 86400);
            parasDic.Add("message", str);
            string Sign = GenerateSign(HTTP_POST, RESTAPI_PUSHSINGLEDEVICE, parasDic);

            parasDic.Add("sign", Sign);
            string paras = "";

            foreach (string item in parasDic.Keys)
            {
                paras += item + "=" + parasDic[item] + "&";
            }
            paras = paras.Length > 0 ? paras.Substring(0, paras.Length - 1) : paras;
            string returnStr = Submit.HttpPost(RESTAPI_PUSHSINGLEDEVICE, paras);

            return(returnStr);
        }