Example #1
0
        public bool GetLicenses()
        {
            string          URL    = licenceUrl;
            SystemWebClient client = new SystemWebClient();

            try{
                licenceFile = client.DownloadString(new Uri(URL));
            }catch (Exception ex) {
                string statusDesc = "";
                GetStatusCode(client, out statusDesc);
                Console.WriteLine(ex.Message);

                return(false);
            }
            return(true);
        }
Example #2
0
        public bool Ping(string token)
        {
            string URL = pingUrl;
            string result;

            SystemWebClient client = new SystemWebClient();

            if (!string.IsNullOrEmpty(token))
            {
                URL = String.Format(URL + "?t={0}", token);
            }
            else
            {
                return(false);
            }
            try{
                result = client.DownloadString(new Uri(URL));

                if (!string.IsNullOrEmpty(result))
                {
                    Licenses lc = Licenses.LoadLicenses(result);
                    //MainClass.User.Licenses = lc;
                    if (lc != null && lc.Items.Count > 0)
                    {
                        MainClass.User.LicenseId = lc.Items[0].Typ;
                    }
                }
            }catch (Exception ex) {
                string statusDesc = "";
                GetStatusCode(client, out statusDesc);
                Console.WriteLine(ex.Message);
                Logger.Error(ex.Message);

                return(false);
            }
            return(true);
        }
Example #3
0
        public bool GetBannerFromWeb()
        {
            string URL =bannerUrl;
            SystemWebClient client = new SystemWebClient();

            try{
                bannerFile = client.DownloadString(new Uri(URL));

            }catch(Exception ex){
                string statusDesc = "";
                GetStatusCode(client,out statusDesc);
                Console.WriteLine(ex.Message);

                return false;
            }
            return true;
        }
Example #4
0
        public bool Ping(string token)
        {
            string URL =pingUrl;
            string result;

            SystemWebClient client = new SystemWebClient();

            if( !string.IsNullOrEmpty(token))
                URL = String.Format(URL+"?t={0}",token);
            else {
                return false;
            }
            try{
                result = client.DownloadString(new Uri(URL));

                if(!string.IsNullOrEmpty(result)){
                    Licenses lc = Licenses.LoadLicenses(result);
                    //MainClass.User.Licenses = lc;
                    if(lc!= null && lc.Items.Count>0){
                        MainClass.User.LicenseId = lc.Items[0].Typ;
                    }
                }

            }catch(Exception ex){
                string statusDesc = "";
                GetStatusCode(client,out statusDesc);
                Console.WriteLine(ex.Message);
                Logger.Error(ex.Message);

                return false;
            }
            return true;
        }