OSDN Git Service

「プロキシの自動設定に失敗しました」のエラーを出にくくする
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Mon, 27 Aug 2018 11:15:35 +0000 (20:15 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Mon, 27 Aug 2018 11:15:35 +0000 (20:15 +0900)
KancolleSniffer/Net/ProxyManager.cs

index 25db943..d4446d4 100644 (file)
@@ -28,7 +28,7 @@ namespace KancolleSniffer.Net
         private readonly SystemProxy _systemProxy = new SystemProxy();\r
         private int _prevProxyPort;\r
         private int _autoConfigRetryCount;\r
-        private readonly Timer _timer = new Timer {Interval = 1000};\r
+        private readonly Timer _timer = new Timer();\r
         private bool _initiated;\r
         private DateTime _pacFileTime;\r
 \r
@@ -124,6 +124,7 @@ namespace KancolleSniffer.Net
         {\r
             SetAutoConfigUrl();\r
             _initiated = false;\r
+            _timer.Interval = 5000;\r
             _timer.Start();\r
         }\r
 \r
@@ -142,9 +143,10 @@ namespace KancolleSniffer.Net
             if (IsProxyWorking)\r
             {\r
                 _initiated = true;\r
+                _timer.Interval = 1000;\r
                 return;\r
             }\r
-            if (_autoConfigRetryCount > 0 && _autoConfigRetryCount % 5 == 0)\r
+            if (_autoConfigRetryCount > 0 && _autoConfigRetryCount % 6 == 0)\r
             {\r
                 _timer.Stop();\r
                 switch (MessageBox.Show(_parent, "プロキシの自動設定に失敗しました。", "エラー", MessageBoxButtons.AbortRetryIgnore,\r