Exemplo n.º 1
0
        public static UpdateSoftEnt GetEnt(string url)
        {
            UpdateSoftEnt c = new UpdateSoftEnt();

            try
            {
                c.ProductVer = Program.ProductVer;
                IAASResponse reponse = IAASRequest.Reauest(url, RequestMethod.GET, "", "", "");
                if (reponse.StatusCode == HttpStatusCode.OK)
                {
                    if (reponse.Content.IndexOf("}") < 0)
                    {
                        reponse.Content = "{" + reponse.Content + "}";
                    }
                    if (reponse.Content.IndexOf("srb_ver_info_s") > 0)
                    {
                        c.ProductVer = reponse.Content.Substring(reponse.Content.IndexOf("srb_ver_info_s"), reponse.Content.IndexOf("srb_ver_info_e") - reponse.Content.IndexOf("srb_ver_info_s")).Replace("=", "").Replace("srb_ver_info_s", "");
                        c.DownUrl    = reponse.Content.Substring(reponse.Content.IndexOf("srb_down_info_s"), reponse.Content.IndexOf("srb_down_info_e") - reponse.Content.IndexOf("srb_down_info_s")).Replace("=", "").Replace("srb_down_info_s", "");
                    }
                    else
                    {
                        c = JsonToObj <UpdateSoftEnt>(reponse.Content);
                    }
                }
            }
            catch
            {
            }
            return(c);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="url"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public static ProDictEntity GetProDict(string url, string key, List <UpdateDictEnt> pl = null)
        {
            ProDictEntity c = new ProDictEntity();


            try
            {
                c.DictList  = pl;
                c.HVID      = Program.HVID;
                c.SearchKey = key;
                RequestEntity r = new RequestEntity();
                r.OptCommand = OptCom.GetProDict.ToString();
                r.Content    = ToJson(c);
                r.Content    = Security.EncryptCommon(r.Content);
                IAASResponse reponse = IAASRequest.Reauest(url, RequestMethod.POST, "", "", ToJson(r));
                if (reponse.StatusCode == HttpStatusCode.OK)
                {
                    c = JsonToObj <ProDictEntity>(reponse.Content);
                }
            }
            catch
            {
                c.DictList = new List <UpdateDictEnt>();
            }
            return(c);
        }
Exemplo n.º 3
0
        public static InfoEntity GetMyInfo(string url)
        {
            InfoEntity c = new InfoEntity();

            c.LastMsgid = LastMsgid;
            try
            {
                c.HVID   = Program.HVID;
                c.ProVer = Program.ProductVer;
                RequestEntity r = new RequestEntity();
                r.OptCommand = OptCom.GetMyInfo.ToString();
                r.Content    = ToJson(c);
                r.Content    = Security.EncryptCommon(r.Content);
                IAASResponse reponse = IAASRequest.Reauest(url, RequestMethod.POST, "", "", ToJson(r));
                if (reponse.StatusCode == HttpStatusCode.OK)
                {
                    c         = JsonToObj <InfoEntity>(reponse.Content);
                    LastMsgid = c.LastMsgid;
                }
                else
                {
                    c.InfoStr = string.Empty;
                }
            }
            catch
            {
                c.InfoStr = string.Empty;
            }
            return(c);
        }
Exemplo n.º 4
0
        public static void EndDictUpdate(string url)
        {
            UpdateDictEnt c = new UpdateDictEnt();

            try
            {
                c.DictVersion = Win.WinInput.DictVersion;
                RequestEntity r = new RequestEntity();
                r.OptCommand = OptCom.EndUpdateDict.ToString();
                r.Content    = ToJson(c);
                r.Content    = Security.EncryptCommon(r.Content);
                IAASResponse reponse = IAASRequest.Reauest(url, RequestMethod.POST, "", "", ToJson(r));
                if (reponse.StatusCode == HttpStatusCode.OK)
                {
                    c = JsonToObj <UpdateDictEnt>(reponse.Content);
                }
            }
            catch
            {
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取dict更新地址
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static ColdDictEntity GetCloudDictUpdate(string url)
        {
            ColdDictEntity c = new ColdDictEntity();

            try
            {
                c.Pos = Win.WinInput.Input.ClouddDit.Count;
                RequestEntity r = new RequestEntity();
                r.OptCommand = OptCom.GetCloudDict.ToString();
                r.Content    = ToJson(c);
                r.Content    = Security.EncryptCommon(r.Content);
                IAASResponse reponse = IAASRequest.Reauest(url, RequestMethod.POST, "", "", ToJson(r));
                if (reponse.StatusCode == HttpStatusCode.OK)
                {
                    c = JsonToObj <ColdDictEntity>(reponse.Content);
                }
            }
            catch
            {
                c.NextHave = false;;
            }
            return(c);
        }