示例#1
0
        static public byte[] GetItem(string id)
        {
            string szRet = HttpBaseLayer.Get(ConfigManager.GetDomain() + "index.php/dump/item_show/" + id, ConfigManager.GetUserAgent());

            try
            {
                return(Convert.FromBase64String(szRet));
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(szRet);
            }

            return(null);
        }
示例#2
0
        static public bool DelItem(string id, out string ret_tip)
        {
            string szRet = HttpBaseLayer.Get(ConfigManager.GetDomain() + "index.php/dump/item_del/" + id, ConfigManager.GetUserAgent());

            try
            {
                JObject obj = JObject.Parse(szRet);
                ret_tip = obj["ret_tip"].ToString();
                return(Convert.ToBoolean(obj["ret_flag"]));
            }
            catch (System.Exception ex)
            {
                ret_tip = szRet;
            }
            return(false);
        }
示例#3
0
        static public List <ListItem> GetList()
        {
            List <ListItem> list  = new List <ListItem>();
            string          szRet = HttpBaseLayer.Get(ConfigManager.GetDomain() + "index.php/dump/list_show", ConfigManager.GetUserAgent());
            //Trace.WriteLine("\n\n" + szRet + "\n\n");
            JArray arr = null;

            try
            {
                arr = JArray.Parse(szRet);
                foreach (JObject obj in arr)
                {
                    ListItem li = new ListItem();
                    li.id    = obj["id"].ToString();
                    li.title = obj["title"].ToString();
                    list.Add(li);
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(szRet);
            }
            return(list);
        }