Beispiel #1
0
        public static string Update(string token, string msg, string gID, PostShareType shareType, PostType postType, out int errorCode)
        {
            errorCode = 0;
            var paras = new Dictionary <string, object>();

            paras.Add("access_token", token);
            paras.Add("p_msg", msg);
            paras.Add("p_msg", msg);
            paras.Add("g_id", gID);
            paras.Add("s_type", (int)shareType);
            paras.Add("p_type", (int)postType);
            var result = HttpRequest.RequestServer(ApiOption.post_update, paras);

            JObject resultObj = (JObject)JsonConvert.DeserializeObject(result);

            if (resultObj != null)
            {
                if (resultObj.Property("error_code") == null)
                {
                    return(resultObj["post"].ToString());
                }
                else
                {
                    errorCode = int.Parse(resultObj["error_code"].ToString());
                }
            }

            return(string.Empty);
        }
Beispiel #2
0
        public static string Update(string token, string msg, string gID, PostShareType shareType, PostType postType, out int errorCode)
        {
            errorCode = 0;
            var paras = new Dictionary<string, object>();
            paras.Add("access_token", token);
            paras.Add("p_msg", msg);
            paras.Add("g_id", gID);
            paras.Add("s_type", (int)shareType);
            paras.Add("p_type", (int)postType);
            var result = HttpRequest.RequestServer(ApiOption.post_update, paras);

            JObject resultObj =(JObject) JsonConvert.DeserializeObject(result);
            if (resultObj != null)
            {
                if (resultObj.Property("error_code") == null)
                    return resultObj["post"].ToString();
                else
                    errorCode =int.Parse( resultObj["error_code"].ToString());
            }

            return string.Empty;
            
        }