This commit is contained in:
clowwindy
2015-01-11 22:22:55 +08:00
parent 797bd863aa
commit 70d7e813a4
+16 -9
View File
@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using System.IO;
namespace Shadowsocks.Controller
{
@@ -79,18 +80,24 @@ namespace Shadowsocks.Controller
RegistryKey registry =
Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Connections",
true);
var defulatValue = registry.GetValue("DefaultConnectionSettings");
var connections = registry.GetValueNames();
foreach (String each in connections){
if (!(each.Equals("DefaultConnectionSettings")
|| each.Equals("LAN Connection")
|| each.Equals("SavedLegacySettings")))
var defaultValue = registry.GetValue("DefaultConnectionSettings");
try
{
var connections = registry.GetValueNames();
foreach (String each in connections)
{
//set all the connections's proxy as the lan
registry.SetValue(each, defulatValue);
if (!(each.Equals("DefaultConnectionSettings")
|| each.Equals("LAN Connection")
|| each.Equals("SavedLegacySettings")))
{
//set all the connections's proxy as the lan
registry.SetValue(each, defaultValue);
}
}
SystemProxy.NotifyIE();
} catch (IOException e) {
Logging.LogUsefulException(e);
}
NotifyIE();
}
private static String GetTimestamp(DateTime value)