Пример #1
0
        public async Task Execute()
        {
            try
            {
                LastReport = "";
                using (var client = new AwaredWebClient("", System.Text.Encoding.UTF8))
                {
                    LastReport = await client.GetAsync(ScriptFileUri, "text/xml");
                }
            }
            catch (WebException ex)
            {
                if (ex.Status == WebExceptionStatus.NameResolutionFailure)
                {
                    Core.Log("App not connected");
                }
                else
                {
                    throw ex;
                }
            }

            if (LastReport == "")
            {
                return;
            }
            LastReport = LastReport.Substring(LastReport.IndexOf("<?xml ver"));
            Core.WriteConfig(config_oa, LastReport);
            Core.WriteConfig(config_oa_time, DateTime.Now.ToString());
            Parse();
        }