mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-24 20:06:54 +00:00
try to fix issue #1549
#1549 提到的确实是个问题,让用户自己设置开关机脚本或者组策略等方法来解决感觉不太好,还是要尽量内部解决一下。本来我也想着通过sysproxy.exe命令去关闭代理,但是发现收到关机信号后就无法再运行其他程序了会报错,所以换了个思路。 这里只简单加了几行,请各位测试一下是否有用。如果可行请作者再完善一下。
This commit is contained in:
parent
f0c59e38cc
commit
a7897debe2
1 changed files with 7 additions and 0 deletions
|
@ -92,6 +92,13 @@ namespace v2rayN.Forms
|
|||
HideForm();
|
||||
return;
|
||||
}
|
||||
if (e.CloseReason == CloseReason.WindowsShutDown)
|
||||
{
|
||||
Microsoft.Win32.RegistryKey reg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
|
||||
reg.SetValue("ProxyEnable", 0);
|
||||
reg.Flush();
|
||||
reg.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void MainForm_Resize(object sender, EventArgs e)
|
||||
|
|
Loading…
Reference in a new issue