try fix #105
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user