try to fix issue #1549

#1549 提到的确实是个问题,让用户自己设置开关机脚本或者组策略等方法来解决感觉不太好,还是要尽量内部解决一下。本来我也想着通过sysproxy.exe命令去关闭代理,但是发现收到关机信号后就无法再运行其他程序了会报错,所以换了个思路。
这里只简单加了几行,请各位测试一下是否有用。如果可行请作者再完善一下。
This commit is contained in:
fangzheng 2021-05-05 13:09:58 +08:00 committed by GitHub
parent f0c59e38cc
commit a7897debe2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)