using System.Runtime.InteropServices;\r
using System.Text;\r
using System.Text.RegularExpressions;\r
-using System.Threading;\r
using System.Threading.Tasks;\r
using System.Windows.Forms;\r
using Microsoft.CSharp.RuntimeBinder;\r
{\r
if (e.Mode != PowerModes.Resume || !_config.Proxy.Auto)\r
return;\r
- Task.Run(() =>\r
- {\r
- for (var i = 0; i < 5; Thread.Sleep(10000), i++)\r
- SystemProxy.Refresh();\r
- });\r
+ SystemProxy.Refresh();\r
}\r
\r
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)\r
public static void Refresh()\r
{\r
InternetSetOption(IntPtr.Zero, InternetOption.INTERNET_OPTION_PROXY_SETTINGS_CHANGED, IntPtr.Zero, 0);\r
- InternetSetOption(IntPtr.Zero, InternetOption.INTERNET_OPTION_REFRESH, IntPtr.Zero, 0);\r
}\r
\r
[DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)]\r