add timestamp in pac url

This commit is contained in:
clowwindy
2014-11-07 01:48:40 +08:00
parent 0859d03f4d
commit 68246e2653
+6 -1
View File
@@ -28,7 +28,7 @@ namespace shadowsocks_csharp
RegistryKey registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
registry.SetValue("ProxyEnable", 0);
registry.SetValue("ProxyServer", "");
registry.SetValue("AutoConfigURL", "http://127.0.0.1:8090/pac");
registry.SetValue("AutoConfigURL", "http://127.0.0.1:8090/pac?t=" + GetTimestamp(DateTime.Now));
SystemProxy.NotifyIE();
}
@@ -40,5 +40,10 @@ namespace shadowsocks_csharp
registry.SetValue("AutoConfigURL", "");
SystemProxy.NotifyIE();
}
private static String GetTimestamp(DateTime value)
{
return value.ToString("yyyyMMddHHmmssffff");
}
}
}