diff --git a/FirehoseFinder.csproj b/FirehoseFinder.csproj index 0c0ea69..0b501ce 100644 --- a/FirehoseFinder.csproj +++ b/FirehoseFinder.csproj @@ -38,7 +38,7 @@ false true 0 - 24.8.7.0 + 24.8.13.0 false true true diff --git a/Forms/Form1.cs b/Forms/Form1.cs index 9e09116..057194c 100644 --- a/Forms/Form1.cs +++ b/Forms/Form1.cs @@ -105,27 +105,35 @@ private void Formfhf_Load(object sender, EventArgs e) if (Settings.Default.update_db == true) { string distr_path = @"https://fhf.yggno.de/db/"; - HttpWebRequest filter_wrq = (HttpWebRequest)WebRequest.Create(Path.Combine(distr_path, "ForFilter.xml")); - HttpWebResponse filter_wrs = (HttpWebResponse)filter_wrq.GetResponse(); - DateTime filter_dt = filter_wrs.LastModified; - filter_wrs.Close(); - HttpWebRequest found_wrq = (HttpWebRequest)WebRequest.Create(Path.Combine(distr_path, "ForFound.xml")); - HttpWebResponse found_wrs = (HttpWebResponse)found_wrq.GetResponse(); - DateTime found_dt = found_wrs.LastModified; - found_wrs.Close(); - //Если на сервере дата больше, чем локально, то копируем - if (filter_dt > File.GetLastWriteTime("ForFilter.xml")) - { - WebClient filter_wc = new WebClient(); - filter_wc.DownloadFile(Path.Combine(distr_path, "ForFilter.xml"), "ForFilter.xml"); - filter_wc.Dispose(); - } - if (found_dt > File.GetLastWriteTime("ForFound.xml")) - { - WebClient found_wc = new WebClient(); - found_wc.DownloadFile(Path.Combine(distr_path, "ForFound.xml"), "ForFound.xml"); - found_wc.Dispose(); + try + { + HttpWebRequest filter_wrq = (HttpWebRequest)WebRequest.Create(Path.Combine(distr_path, "ForFilter.xml")); + HttpWebResponse filter_wrs = (HttpWebResponse)filter_wrq.GetResponse(); + DateTime filter_dt = filter_wrs.LastModified; + filter_wrs.Close(); + HttpWebRequest found_wrq = (HttpWebRequest)WebRequest.Create(Path.Combine(distr_path, "ForFound.xml")); + HttpWebResponse found_wrs = (HttpWebResponse)found_wrq.GetResponse(); + DateTime found_dt = found_wrs.LastModified; + found_wrs.Close(); + //Если на сервере дата больше, чем локально, то копируем + if (filter_dt > File.GetLastWriteTime("ForFilter.xml")) + { + WebClient filter_wc = new WebClient(); + filter_wc.DownloadFile(Path.Combine(distr_path, "ForFilter.xml"), "ForFilter.xml"); + filter_wc.Dispose(); + } + if (found_dt > File.GetLastWriteTime("ForFound.xml")) + { + WebClient found_wc = new WebClient(); + found_wc.DownloadFile(Path.Combine(distr_path, "ForFound.xml"), "ForFound.xml"); + found_wc.Dispose(); + } } + catch (WebException ex) //При отсутствии инета + { + textBox_soft_term.AppendText(ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine); + } + } //Загружаем Справочник устройств dataSet1.ReadXml("ForFilter.xml", XmlReadMode.ReadSchema); diff --git a/Forms/Form1.resx b/Forms/Form1.resx index a358d95..f28cdb9 100644 --- a/Forms/Form1.resx +++ b/Forms/Form1.resx @@ -123,7 +123,7 @@ - 0, 587 + 0, 585 17, 58 @@ -437,7 +437,7 @@ NoControl - 3, 602 + 3, 604 394, 14 @@ -539,7 +539,7 @@ Выход - 59, 26 + 59, 24 Файл @@ -596,7 +596,7 @@ Поделиться программером - 49, 26 + 49, 24 Вид @@ -626,7 +626,7 @@ Извлечь сертификаты - 117, 26 + 117, 24 Инструменты @@ -644,7 +644,7 @@ О программе - 81, 26 + 81, 24 Справка @@ -653,7 +653,7 @@ 0, 0 - 1369, 30 + 1369, 28 1 @@ -683,7 +683,7 @@ 51 - 1361, 587 + 1361, 585 2 @@ -704,7 +704,7 @@ 4, 25 - 1361, 627 + 1361, 625 4 @@ -1902,7 +1902,7 @@ _HASH Vertical - 388, 512 + 388, 514 1 @@ -1926,7 +1926,7 @@ _HASH 3, 3 - 394, 533 + 394, 535 7 @@ -2160,7 +2160,7 @@ _HASH 3, 133 - 923, 421 + 923, 423 7 @@ -2259,7 +2259,7 @@ _HASH 3 - 929, 557 + 929, 559 8 @@ -2286,7 +2286,7 @@ _HASH 3, 3, 3, 3 - 935, 563 + 935, 565 0 @@ -3024,7 +3024,7 @@ _HASH Bottom - 3, 223 + 3, 221 929, 339 @@ -3210,7 +3210,7 @@ _HASH 3, 3, 3, 3 - 935, 565 + 935, 563 1 @@ -3567,7 +3567,7 @@ _HASH 3, 133 - 929, 429 + 929, 427 1 @@ -3666,7 +3666,7 @@ _HASH 3 - 935, 565 + 935, 563 0 @@ -3690,7 +3690,7 @@ _HASH 4, 25 - 935, 565 + 935, 563 2 @@ -3717,7 +3717,7 @@ _HASH 3, 18 - 943, 592 + 943, 594 0 @@ -3741,7 +3741,7 @@ _HASH 403, 3 - 949, 613 + 949, 615 8 @@ -3831,7 +3831,7 @@ _HASH Fill - 3, 542 + 3, 544 394, 54 @@ -3864,7 +3864,7 @@ _HASH 3 - 1355, 619 + 1355, 621 8 @@ -3891,7 +3891,7 @@ _HASH 3, 3, 3, 3 - 1361, 625 + 1361, 627 2 @@ -3915,13 +3915,13 @@ _HASH Fill - 0, 30 + 0, 28 3, 2, 3, 2 - 1369, 654 + 1369, 656 0 diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index fd4c9fa..4dfbd21 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // Можно задать все значения или принять номера сборки и редакции по умолчанию // используя "*", как показано ниже: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("24.8.7.0")] -[assembly: AssemblyFileVersion("24.8.7.0")] +[assembly: AssemblyVersion("24.8.13.0")] +[assembly: AssemblyFileVersion("24.8.13.0")] [assembly: NeutralResourcesLanguage("ru-RU")]