From 68246e2653301f23469a8909408bd692b7c23956 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Fri, 7 Nov 2014 01:48:40 +0800 Subject: [PATCH] add timestamp in pac url --- shadowsocks-csharp/Controller/SystemProxy.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shadowsocks-csharp/Controller/SystemProxy.cs b/shadowsocks-csharp/Controller/SystemProxy.cs index a024d8db..c41bbf11 100755 --- a/shadowsocks-csharp/Controller/SystemProxy.cs +++ b/shadowsocks-csharp/Controller/SystemProxy.cs @@ -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"); + } } }