Skip to content

Commit

Permalink
Исправлена ошибка запуска без инета
Browse files Browse the repository at this point in the history
  • Loading branch information
hoplik committed Aug 13, 2024
1 parent 0c96548 commit 40aa0e9
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 49 deletions.
2 changes: 1 addition & 1 deletion FirehoseFinder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>24.8.7.0</ApplicationVersion>
<ApplicationVersion>24.8.13.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down
48 changes: 28 additions & 20 deletions Forms/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
52 changes: 26 additions & 26 deletions Forms/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="splitContainer1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 587</value>
<value>0, 585</value>
</data>
<metadata name="bindingNavigator_collection.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 58</value>
Expand Down Expand Up @@ -437,7 +437,7 @@
<value>NoControl</value>
</data>
<data name="progressBar_phone.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 602</value>
<value>3, 604</value>
</data>
<data name="progressBar_phone.Size" type="System.Drawing.Size, System.Drawing">
<value>394, 14</value>
Expand Down Expand Up @@ -539,7 +539,7 @@
<value>Выход</value>
</data>
<data name="файлToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 26</value>
<value>59, 24</value>
</data>
<data name="файлToolStripMenuItem.Text" xml:space="preserve">
<value>Файл</value>
Expand Down Expand Up @@ -596,7 +596,7 @@
<value>Поделиться программером</value>
</data>
<data name="видToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>49, 26</value>
<value>49, 24</value>
</data>
<data name="видToolStripMenuItem.Text" xml:space="preserve">
<value>Вид</value>
Expand Down Expand Up @@ -626,7 +626,7 @@
<value>Извлечь сертификаты</value>
</data>
<data name="инструментыToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>117, 26</value>
<value>117, 24</value>
</data>
<data name="инструментыToolStripMenuItem.Text" xml:space="preserve">
<value>Инструменты</value>
Expand All @@ -644,7 +644,7 @@
<value>О программе</value>
</data>
<data name="справкаToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>81, 26</value>
<value>81, 24</value>
</data>
<data name="справкаToolStripMenuItem.Text" xml:space="preserve">
<value>Справка</value>
Expand All @@ -653,7 +653,7 @@
<value>0, 0</value>
</data>
<data name="menuStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>1369, 30</value>
<value>1369, 28</value>
</data>
<data name="menuStrip1.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
Expand Down Expand Up @@ -683,7 +683,7 @@
<value>51</value>
</data>
<data name="dataGridView_collection.Size" type="System.Drawing.Size, System.Drawing">
<value>1361, 587</value>
<value>1361, 585</value>
</data>
<data name="dataGridView_collection.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
Expand All @@ -704,7 +704,7 @@
<value>4, 25</value>
</data>
<data name="tabPage_collection.Size" type="System.Drawing.Size, System.Drawing">
<value>1361, 627</value>
<value>1361, 625</value>
</data>
<data name="tabPage_collection.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
Expand Down Expand Up @@ -1902,7 +1902,7 @@ _HASH</value>
<value>Vertical</value>
</data>
<data name="textBox_soft_term.Size" type="System.Drawing.Size, System.Drawing">
<value>388, 512</value>
<value>388, 514</value>
</data>
<data name="textBox_soft_term.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
Expand All @@ -1926,7 +1926,7 @@ _HASH</value>
<value>3, 3</value>
</data>
<data name="groupBox_terminal.Size" type="System.Drawing.Size, System.Drawing">
<value>394, 533</value>
<value>394, 535</value>
</data>
<data name="groupBox_terminal.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
Expand Down Expand Up @@ -2160,7 +2160,7 @@ _HASH</value>
<value>3, 133</value>
</data>
<data name="groupBox_adb_commands.Size" type="System.Drawing.Size, System.Drawing">
<value>923, 421</value>
<value>923, 423</value>
</data>
<data name="groupBox_adb_commands.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
Expand Down Expand Up @@ -2259,7 +2259,7 @@ _HASH</value>
<value>3</value>
</data>
<data name="tableLayoutPanel_adb.Size" type="System.Drawing.Size, System.Drawing">
<value>929, 557</value>
<value>929, 559</value>
</data>
<data name="tableLayoutPanel_adb.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
Expand All @@ -2286,7 +2286,7 @@ _HASH</value>
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage_adb.Size" type="System.Drawing.Size, System.Drawing">
<value>935, 563</value>
<value>935, 565</value>
</data>
<data name="tabPage_adb.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
Expand Down Expand Up @@ -3024,7 +3024,7 @@ _HASH</value>
<value>Bottom</value>
</data>
<data name="groupBox_LUN.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 223</value>
<value>3, 221</value>
</data>
<data name="groupBox_LUN.Size" type="System.Drawing.Size, System.Drawing">
<value>929, 339</value>
Expand Down Expand Up @@ -3210,7 +3210,7 @@ _HASH</value>
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage_sahara.Size" type="System.Drawing.Size, System.Drawing">
<value>935, 565</value>
<value>935, 563</value>
</data>
<data name="tabPage_sahara.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
Expand Down Expand Up @@ -3567,7 +3567,7 @@ _HASH</value>
<value>3, 133</value>
</data>
<data name="groupBox_fb_commands.Size" type="System.Drawing.Size, System.Drawing">
<value>929, 429</value>
<value>929, 427</value>
</data>
<data name="groupBox_fb_commands.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
Expand Down Expand Up @@ -3666,7 +3666,7 @@ _HASH</value>
<value>3</value>
</data>
<data name="tableLayoutPanel_fb.Size" type="System.Drawing.Size, System.Drawing">
<value>935, 565</value>
<value>935, 563</value>
</data>
<data name="tableLayoutPanel_fb.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
Expand All @@ -3690,7 +3690,7 @@ _HASH</value>
<value>4, 25</value>
</data>
<data name="tabPage_fb.Size" type="System.Drawing.Size, System.Drawing">
<value>935, 565</value>
<value>935, 563</value>
</data>
<data name="tabPage_fb.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
Expand All @@ -3717,7 +3717,7 @@ _HASH</value>
<value>3, 18</value>
</data>
<data name="tabControl_soft.Size" type="System.Drawing.Size, System.Drawing">
<value>943, 592</value>
<value>943, 594</value>
</data>
<data name="tabControl_soft.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
Expand All @@ -3741,7 +3741,7 @@ _HASH</value>
<value>403, 3</value>
</data>
<data name="groupBox_soft.Size" type="System.Drawing.Size, System.Drawing">
<value>949, 613</value>
<value>949, 615</value>
</data>
<data name="groupBox_soft.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
Expand Down Expand Up @@ -3831,7 +3831,7 @@ _HASH</value>
<value>Fill</value>
</data>
<data name="groupBox_term_buttons.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 542</value>
<value>3, 544</value>
</data>
<data name="groupBox_term_buttons.Size" type="System.Drawing.Size, System.Drawing">
<value>394, 54</value>
Expand Down Expand Up @@ -3864,7 +3864,7 @@ _HASH</value>
<value>3</value>
</data>
<data name="tableLayoutPanel_phone.Size" type="System.Drawing.Size, System.Drawing">
<value>1355, 619</value>
<value>1355, 621</value>
</data>
<data name="tableLayoutPanel_phone.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
Expand All @@ -3891,7 +3891,7 @@ _HASH</value>
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage_phone.Size" type="System.Drawing.Size, System.Drawing">
<value>1361, 625</value>
<value>1361, 627</value>
</data>
<data name="tabPage_phone.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
Expand All @@ -3915,13 +3915,13 @@ _HASH</value>
<value>Fill</value>
</data>
<data name="tabControl1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 30</value>
<value>0, 28</value>
</data>
<data name="tabControl1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 2, 3, 2</value>
</data>
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>1369, 654</value>
<value>1369, 656</value>
</data>
<data name="tabControl1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit 40aa0e9

Please sign in to comment.