Beispiel #1
0
        public string Send(string access_token, string openid)
        {
            string arg_10_0  = base.Request["type"];
            string arg_21_0  = base.Request["data"];
            string postData  = "{\"touser\":\"" + openid + "\",\"msgtype\":\"text\",\"text\": {\"content\":\"欢迎您的来访!\"}}";
            string msg       = NewsApi.KFSend(access_token, postData);
            string jsonValue = NewsApi.GetJsonValue(msg, "media_id");
            string text      = NewsApi.Send(access_token, NewsApi.CreateImageNewsJson(jsonValue));

            if (string.IsNullOrWhiteSpace(text))
            {
                return("{\"code\":0,\"msg\":\"type参数错误\"}");
            }
            string jsonValue2 = NewsApi.GetJsonValue(text, "errcode");
            string jsonValue3 = NewsApi.GetJsonValue(text, "errmsg");

            if (jsonValue2 == "0")
            {
                return("{\"code\":1,\"msg\":\"\"}");
            }
            return(string.Concat(new string[]
            {
                "{\"code\":0,\"msg\":\"errcode:",
                jsonValue2,
                ", errmsg:",
                jsonValue3,
                "\"}"
            }));
        }
Beispiel #2
0
        public string Send(string access_token, string openid)
        {
            string text1     = base.Request["type"];
            string text2     = base.Request["data"];
            string postData  = "{\"touser\":\"" + openid + "\",\"msgtype\":\"text\",\"text\": {\"content\":\"欢迎您的来访!\"}}";
            string str2      = null;
            string jsonValue = NewsApi.GetJsonValue(NewsApi.KFSend(access_token, postData), "media_id");

            str2 = NewsApi.Send(access_token, NewsApi.CreateImageNewsJson(jsonValue));
            StreamWriter writer = File.AppendText(base.Server.MapPath("error.txt"));

            writer.WriteLine(str2);
            writer.WriteLine(DateTime.Now);
            writer.Flush();
            writer.Close();
            if (string.IsNullOrWhiteSpace(str2))
            {
                return("{\"code\":0,\"msg\":\"type参数错误\"}");
            }
            string str5 = NewsApi.GetJsonValue(str2, "errcode");
            string str6 = NewsApi.GetJsonValue(str2, "errmsg");

            if (str5 == "0")
            {
                return("{\"code\":1,\"msg\":\"\"}");
            }
            return("{\"code\":0,\"msg\":\"errcode:" + str5 + ", errmsg:" + str6 + "\"}");
        }
Beispiel #3
0
        public string Send(string access_token, string openid)
        {
            string text1     = base.Request["type"];
            string text2     = base.Request["data"];
            string postData  = "{\"touser\":\"" + openid + "\",\"msgtype\":\"text\",\"text\": {\"content\":\"欢迎您的来访!\"}}";
            string msg       = null;
            string jsonValue = NewsApi.GetJsonValue(NewsApi.KFSend(access_token, postData), "media_id");

            msg = NewsApi.Send(access_token, NewsApi.CreateImageNewsJson(jsonValue));
            if (string.IsNullOrWhiteSpace(msg))
            {
                return("{\"code\":0,\"msg\":\"type参数错误\"}");
            }
            string str5 = NewsApi.GetJsonValue(msg, "errcode");
            string str6 = NewsApi.GetJsonValue(msg, "errmsg");

            if (str5 == "0")
            {
                return("{\"code\":1,\"msg\":\"\"}");
            }
            return("{\"code\":0,\"msg\":\"errcode:" + str5 + ", errmsg:" + str6 + "\"}");
        }