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(); }
public async Task Execute() { using (var client = new AwaredWebClient("", System.Text.Encoding.UTF8)) LastReport = await client.GetAsync(ScriptFileUri, "application/rss+xml"); LastReport = LastReport.Trim(); Parse(); Core.WriteConfig(StorageFile, LastReport); Core.WriteConfig(StorageFile + ".time", DateTime.Now.ToString()); }