Browse Source

try fix #105

tags/2.3
clowwindy 9 years ago
parent
commit
70d7e813a4
1 changed files with 16 additions and 9 deletions
  1. +16
    -9
      shadowsocks-csharp/Controller/SystemProxy.cs

+ 16
- 9
shadowsocks-csharp/Controller/SystemProxy.cs 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)


Loading…
Cancel
Save