up sysproxy

This commit is contained in:
2dust 2020-03-13 14:37:18 +08:00
parent c71caec9df
commit 593313a684
16 changed files with 3855 additions and 3549 deletions

View file

@ -60,8 +60,8 @@
this.menuExport2ServerConfig = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2ShareUrl = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2SubContent = new System.Windows.Forms.ToolStripMenuItem();
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem();
@ -70,6 +70,8 @@
this.menuGlobalPAC = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeep = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepPAC = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepPACNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuServers = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddServers2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuScanScreen2 = new System.Windows.Forms.ToolStripMenuItem();
@ -111,8 +113,8 @@
this.tsbCheckClearPACList = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.tsbHelp = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbV2rayWebsite = new System.Windows.Forms.ToolStripMenuItem();
this.tsbAbout = new System.Windows.Forms.ToolStripMenuItem();
this.tsbV2rayWebsite = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
this.tsbLanguageDef = new System.Windows.Forms.ToolStripMenuItem();
this.tsbLanguageZhHans = new System.Windows.Forms.ToolStripMenuItem();
@ -358,11 +360,6 @@
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
//
// qrCodeControl
//
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
this.qrCodeControl.Name = "qrCodeControl";
//
// tsbServer
//
this.tsbServer.DropDown = this.cmsLv;
@ -370,6 +367,11 @@
resources.ApplyResources(this.tsbServer, "tsbServer");
this.tsbServer.Name = "tsbServer";
//
// qrCodeControl
//
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
this.qrCodeControl.Name = "qrCodeControl";
//
// notifyMain
//
this.notifyMain.ContextMenuStrip = this.cmsMain;
@ -400,7 +402,9 @@
this.menuGlobal,
this.menuGlobalPAC,
this.menuKeep,
this.menuKeepPAC});
this.menuKeepPAC,
this.menuKeepNothing,
this.menuKeepPACNothing});
this.menuSysAgentMode.Name = "menuSysAgentMode";
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
//
@ -434,6 +438,18 @@
resources.ApplyResources(this.menuKeepPAC, "menuKeepPAC");
this.menuKeepPAC.Click += new System.EventHandler(this.menuKeepPAC_Click);
//
// menuKeepNothing
//
this.menuKeepNothing.Name = "menuKeepNothing";
resources.ApplyResources(this.menuKeepNothing, "menuKeepNothing");
this.menuKeepNothing.Click += new System.EventHandler(this.menuKeepNothing_Click);
//
// menuKeepPACNothing
//
this.menuKeepPACNothing.Name = "menuKeepPACNothing";
resources.ApplyResources(this.menuKeepPACNothing, "menuKeepPACNothing");
this.menuKeepPACNothing.Click += new System.EventHandler(this.menuKeepPACNothing_Click);
//
// menuServers
//
this.menuServers.Name = "menuServers";
@ -713,18 +729,18 @@
resources.ApplyResources(this.tsbHelp, "tsbHelp");
this.tsbHelp.Name = "tsbHelp";
//
// tsbV2rayWebsite
//
this.tsbV2rayWebsite.Name = "tsbV2rayWebsite";
resources.ApplyResources(this.tsbV2rayWebsite, "tsbV2rayWebsite");
this.tsbV2rayWebsite.Click += new System.EventHandler(this.tsbV2rayWebsite_Click);
//
// tsbAbout
//
this.tsbAbout.Name = "tsbAbout";
resources.ApplyResources(this.tsbAbout, "tsbAbout");
this.tsbAbout.Click += new System.EventHandler(this.tsbAbout_Click);
//
// tsbV2rayWebsite
//
this.tsbV2rayWebsite.Name = "tsbV2rayWebsite";
resources.ApplyResources(this.tsbV2rayWebsite, "tsbV2rayWebsite");
this.tsbV2rayWebsite.Click += new System.EventHandler(this.tsbV2rayWebsite_Click);
//
// toolStripSeparator12
//
this.toolStripSeparator12.Name = "toolStripSeparator12";
@ -886,6 +902,8 @@
private System.Windows.Forms.ToolStripMenuItem menuNotEnabledHttp;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem tsbV2rayWebsite;
private System.Windows.Forms.ToolStripMenuItem menuKeepNothing;
private System.Windows.Forms.ToolStripMenuItem menuKeepPACNothing;
}
}

File diff suppressed because it is too large Load diff

View file

@ -423,34 +423,46 @@
<value>NoControl</value>
</data>
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 22</value>
<value>411, 22</value>
</data>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>Not Enabled Http Proxy</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 22</value>
<value>411, 22</value>
</data>
<data name="menuGlobal.Text" xml:space="preserve">
<value>Open Http proxy and automatically configure proxy server (global mode)</value>
<value>Open Http proxy and set the system proxy (global mode)</value>
</data>
<data name="menuGlobalPAC.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 22</value>
<value>411, 22</value>
</data>
<data name="menuGlobalPAC.Text" xml:space="preserve">
<value>Open PAC and automatically configure PAC (PAC mode)</value>
<value>Open PAC and set the system proxy (PAC mode)</value>
</data>
<data name="menuKeep.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 22</value>
<value>411, 22</value>
</data>
<data name="menuKeep.Text" xml:space="preserve">
<value>Only open Http proxy, do not automatically configure proxy server (direct mode)</value>
<value>Only open Http proxy and clear the proxy settings</value>
</data>
<data name="menuKeepPAC.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 22</value>
<value>411, 22</value>
</data>
<data name="menuKeepPAC.Text" xml:space="preserve">
<value>Only open PAC, do not automatically configure PAC</value>
<value>Only open PAC and clear the proxy settings</value>
</data>
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 22</value>
</data>
<data name="menuKeepNothing.Text" xml:space="preserve">
<value>Only open Http proxy and do nothing</value>
</data>
<data name="menuKeepPACNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 22</value>
</data>
<data name="menuKeepPACNothing.Text" xml:space="preserve">
<value>Only open PAC and do nothing</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value>
@ -492,7 +504,7 @@
<value>Exit</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>265, 142</value>
<value>265, 164</value>
</data>
<data name="&gt;&gt;cmsMain.Name" xml:space="preserve">
<value>cmsMain</value>
@ -1163,6 +1175,18 @@
<data name="&gt;&gt;menuKeepPAC.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuKeepNothing.Name" xml:space="preserve">
<value>menuKeepNothing</value>
</data>
<data name="&gt;&gt;menuKeepNothing.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuKeepPACNothing.Name" xml:space="preserve">
<value>menuKeepPACNothing</value>
</data>
<data name="&gt;&gt;menuKeepPACNothing.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuServers.Name" xml:space="preserve">
<value>menuServers</value>
</data>
@ -1373,18 +1397,18 @@
<data name="&gt;&gt;tsbHelp.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsbV2rayWebsite.Name" xml:space="preserve">
<value>tsbV2rayWebsite</value>
</data>
<data name="&gt;&gt;tsbV2rayWebsite.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsbAbout.Name" xml:space="preserve">
<value>tsbAbout</value>
</data>
<data name="&gt;&gt;tsbAbout.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsbV2rayWebsite.Name" xml:space="preserve">
<value>tsbV2rayWebsite</value>
</data>
<data name="&gt;&gt;tsbV2rayWebsite.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripSeparator12.Name" xml:space="preserve">
<value>toolStripSeparator12</value>
</data>

View file

@ -119,151 +119,151 @@
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="menuAddVmessServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuAddVmessServer.Text" xml:space="preserve">
<value>添加[VMess]服务器</value>
</data>
<data name="menuAddShadowsocksServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuAddShadowsocksServer.Text" xml:space="preserve">
<value>添加[Shadowsocks]服务器</value>
</data>
<data name="menuAddSocksServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuAddSocksServer.Text" xml:space="preserve">
<value>添加[Socks]服务器</value>
</data>
<data name="menuAddCustomServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuAddCustomServer.Text" xml:space="preserve">
<value>添加自定义配置服务器</value>
</data>
<data name="menuAddServers.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuAddServers.Text" xml:space="preserve">
<value>从剪贴板导入批量URL (Ctrl+V)</value>
</data>
<data name="menuScanScreen.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuScanScreen.Text" xml:space="preserve">
<value>扫描屏幕上的二维码 (Ctrl+S)</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>297, 6</value>
</data>
<data name="menuRemoveServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuRemoveServer.Text" xml:space="preserve">
<value>移除所选服务器(多选) (Delete)</value>
</data>
<data name="menuRemoveDuplicateServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuRemoveDuplicateServer.Text" xml:space="preserve">
<value>移除重复的服务器</value>
</data>
<data name="menuCopyServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuCopyServer.Text" xml:space="preserve">
<value>克隆所选服务器</value>
</data>
<data name="menuSetDefaultServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuSetDefaultServer.Text" xml:space="preserve">
<value>设为活动服务器 (Enter)</value>
</data>
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>297, 6</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuMoveTop.Text" xml:space="preserve">
<value>上移至顶 (T)</value>
</data>
<data name="menuMoveUp.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuMoveUp.Text" xml:space="preserve">
<value>上移 (U)</value>
</data>
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuMoveDown.Text" xml:space="preserve">
<value>下移 (D)</value>
</data>
<data name="menuMoveBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>下移至底 (B)</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="toolStripSeparator9.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>297, 6</value>
</data>
<data name="menuPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuPingServer.Text" xml:space="preserve">
<value>测试服务器延迟Ping(多选) (Ctrl+P)</value>
</data>
<data name="menuTcpingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuTcpingServer.Text" xml:space="preserve">
<value>测试服务器延迟Tcping(多选) (Ctrl+O)</value>
</data>
<data name="menuRealPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuRealPingServer.Text" xml:space="preserve">
<value>测试服务器真连接延迟(多选) (Ctrl+R)</value>
</data>
<data name="menuSpeedServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuSpeedServer.Text" xml:space="preserve">
<value>测试服务器速度(多选) (Ctrl+T)</value>
</data>
<data name="toolStripSeparator6.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>297, 6</value>
</data>
<data name="menuExport2ClientConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuExport2ClientConfig.Text" xml:space="preserve">
<value>导出所选服务器为客户端配置</value>
</data>
<data name="menuExport2ServerConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuExport2ServerConfig.Text" xml:space="preserve">
<value>导出所选服务器为服务端配置</value>
</data>
<data name="menuExport2ShareUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuExport2ShareUrl.Text" xml:space="preserve">
<value>批量导出分享URL至剪贴板(多选) (Ctrl+C)</value>
</data>
<data name="menuExport2SubContent.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>300, 22</value>
</data>
<data name="menuExport2SubContent.Text" xml:space="preserve">
<value>批量导出订阅内容至剪贴板(多选)</value>
@ -275,7 +275,7 @@
<value> 服务器 </value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>279, 534</value>
<value>301, 534</value>
</data>
<data name="lvServers.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
@ -295,34 +295,46 @@
</value>
</data>
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
<value>316, 22</value>
</data>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>关闭Http代理</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
<value>316, 22</value>
</data>
<data name="menuGlobal.Text" xml:space="preserve">
<value>开启Http代理,并自动配置代理服务器(全局模式)</value>
<value>开启Http代理,并自动配置系统代理(全局模式)</value>
</data>
<data name="menuGlobalPAC.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
<value>316, 22</value>
</data>
<data name="menuGlobalPAC.Text" xml:space="preserve">
<value>开启PAC,并自动配置PAC(PAC模式)</value>
<value>开启PAC,并自动配置系统代理(PAC模式)</value>
</data>
<data name="menuKeep.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
<value>316, 22</value>
</data>
<data name="menuKeep.Text" xml:space="preserve">
<value>仅开启Http代理,不自动配置代理服务器(直连模式)</value>
<value>仅开启Http代理,并清除系统代理</value>
</data>
<data name="menuKeepPAC.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
<value>316, 22</value>
</data>
<data name="menuKeepPAC.Text" xml:space="preserve">
<value>仅开启PAC,不自动配置PAC</value>
<value>仅开启PAC,并清除系统代理</value>
</data>
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeepNothing.Text" xml:space="preserve">
<value>仅开启Http代理,不改变系统代理</value>
</data>
<data name="menuKeepPACNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeepPACNothing.Text" xml:space="preserve">
<value>仅开启PAC,不改变系统代理</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
@ -402,7 +414,7 @@
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
@ -417,25 +429,28 @@
<value> 重启服务 </value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 22</value>
<value>223, 22</value>
</data>
<data name="tsbCheckUpdateN.Text" xml:space="preserve">
<value>v2rayN</value>
</data>
<data name="tsbCheckUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 22</value>
<value>223, 22</value>
</data>
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
<value>v2rayCore</value>
</data>
<data name="tsbCheckUpdatePACList.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 22</value>
<value>223, 22</value>
</data>
<data name="tsbCheckUpdatePACList.Text" xml:space="preserve">
<value>PAC</value>
</data>
<data name="toolStripSeparator13.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 6</value>
</data>
<data name="tsbCheckClearPACList.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 22</value>
<value>223, 22</value>
</data>
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
<value>简化PAC (请设置Core路由)</value>
@ -446,12 +461,12 @@
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value> 检查更新 </value>
</data>
<data name="tsbV2rayWebsite.Text" xml:space="preserve">
<value>V2Ray 官网</value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>v2rayN 项目</value>
</data>
<data name="tsbV2rayWebsite.Text" xml:space="preserve">
<value>V2Ray 官网</value>
</data>
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 53</value>
</data>
@ -467,10 +482,13 @@
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsbClose.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 53</value>
</data>
<data name="tsbClose.Text" xml:space="preserve">
<value> 关闭窗口 </value>
</data>

View file

@ -118,32 +118,33 @@
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// tabControl1
//
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPage9);
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox1);
resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Name = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.cmblistenerType);
this.groupBox1.Controls.Add(this.chksniffingEnabled2);
@ -164,7 +165,6 @@
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtlocalPort);
this.groupBox1.Controls.Add(this.label2);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
@ -175,6 +175,7 @@
//
// cmblistenerType
//
resources.ApplyResources(this.cmblistenerType, "cmblistenerType");
this.cmblistenerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmblistenerType.FormattingEnabled = true;
this.cmblistenerType.Items.AddRange(new object[] {
@ -182,8 +183,9 @@
resources.GetString("cmblistenerType.Items1"),
resources.GetString("cmblistenerType.Items2"),
resources.GetString("cmblistenerType.Items3"),
resources.GetString("cmblistenerType.Items4")});
resources.ApplyResources(this.cmblistenerType, "cmblistenerType");
resources.GetString("cmblistenerType.Items4"),
resources.GetString("cmblistenerType.Items5"),
resources.GetString("cmblistenerType.Items6")});
this.cmblistenerType.Name = "cmblistenerType";
//
// chksniffingEnabled2
@ -229,12 +231,12 @@
//
// cmbprotocol2
//
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbprotocol2.FormattingEnabled = true;
this.cmbprotocol2.Items.AddRange(new object[] {
resources.GetString("cmbprotocol2.Items"),
resources.GetString("cmbprotocol2.Items1")});
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
this.cmbprotocol2.Name = "cmbprotocol2";
//
// label3
@ -249,8 +251,8 @@
//
// cmbprotocol
//
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbprotocol.FormattingEnabled = true;
this.cmbprotocol.Items.AddRange(new object[] {
resources.GetString("cmbprotocol.Items"),
@ -276,6 +278,7 @@
//
// cmbloglevel
//
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbloglevel.FormattingEnabled = true;
this.cmbloglevel.Items.AddRange(new object[] {
@ -284,7 +287,6 @@
resources.GetString("cmbloglevel.Items2"),
resources.GetString("cmbloglevel.Items3"),
resources.GetString("cmbloglevel.Items4")});
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.Name = "cmbloglevel";
//
// label5
@ -304,33 +306,33 @@
//
// tabPage2
//
this.tabPage2.Controls.Add(this.groupBox2);
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Controls.Add(this.groupBox2);
this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.tabControl2);
this.groupBox2.Controls.Add(this.panel3);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// tabControl2
//
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Controls.Add(this.tabPage3);
this.tabControl2.Controls.Add(this.tabPage4);
this.tabControl2.Controls.Add(this.tabPage5);
this.tabControl2.Controls.Add(this.tabPage8);
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.txtUseragent);
resources.ApplyResources(this.tabPage3, "tabPage3");
this.tabPage3.Controls.Add(this.txtUseragent);
this.tabPage3.Name = "tabPage3";
this.tabPage3.UseVisualStyleBackColor = true;
//
@ -341,8 +343,8 @@
//
// tabPage4
//
this.tabPage4.Controls.Add(this.txtUserdirect);
resources.ApplyResources(this.tabPage4, "tabPage4");
this.tabPage4.Controls.Add(this.txtUserdirect);
this.tabPage4.Name = "tabPage4";
this.tabPage4.UseVisualStyleBackColor = true;
//
@ -353,8 +355,8 @@
//
// tabPage5
//
this.tabPage5.Controls.Add(this.txtUserblock);
resources.ApplyResources(this.tabPage5, "tabPage5");
this.tabPage5.Controls.Add(this.txtUserblock);
this.tabPage5.Name = "tabPage5";
this.tabPage5.UseVisualStyleBackColor = true;
//
@ -365,13 +367,14 @@
//
// tabPage8
//
this.tabPage8.Controls.Add(this.cmbroutingMode);
resources.ApplyResources(this.tabPage8, "tabPage8");
this.tabPage8.Controls.Add(this.cmbroutingMode);
this.tabPage8.Name = "tabPage8";
this.tabPage8.UseVisualStyleBackColor = true;
//
// cmbroutingMode
//
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbroutingMode.FormattingEnabled = true;
this.cmbroutingMode.Items.AddRange(new object[] {
@ -379,16 +382,15 @@
resources.GetString("cmbroutingMode.Items1"),
resources.GetString("cmbroutingMode.Items2"),
resources.GetString("cmbroutingMode.Items3")});
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
this.cmbroutingMode.Name = "cmbroutingMode";
//
// panel3
//
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.btnSetDefRountingRule);
this.panel3.Controls.Add(this.labRoutingTips);
this.panel3.Controls.Add(this.cmbdomainStrategy);
this.panel3.Controls.Add(this.label15);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
// btnSetDefRountingRule
@ -400,19 +402,19 @@
//
// labRoutingTips
//
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
this.labRoutingTips.Name = "labRoutingTips";
//
// cmbdomainStrategy
//
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainStrategy.FormattingEnabled = true;
this.cmbdomainStrategy.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy.Items"),
resources.GetString("cmbdomainStrategy.Items1"),
resources.GetString("cmbdomainStrategy.Items2")});
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
//
// label15
@ -422,6 +424,7 @@
//
// tabPage6
//
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Controls.Add(this.chkKcpcongestion);
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
this.tabPage6.Controls.Add(this.label10);
@ -435,7 +438,6 @@
this.tabPage6.Controls.Add(this.label7);
this.tabPage6.Controls.Add(this.txtKcpmtu);
this.tabPage6.Controls.Add(this.label6);
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Name = "tabPage6";
this.tabPage6.UseVisualStyleBackColor = true;
//
@ -507,6 +509,7 @@
//
// tabPage7
//
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Controls.Add(this.cbFreshrate);
this.tabPage7.Controls.Add(this.lbFreshrate);
this.tabPage7.Controls.Add(this.chkEnableStatistics);
@ -514,15 +517,14 @@
this.tabPage7.Controls.Add(this.txturlGFWList);
this.tabPage7.Controls.Add(this.label13);
this.tabPage7.Controls.Add(this.chkAutoRun);
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true;
//
// cbFreshrate
//
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbFreshrate.FormattingEnabled = true;
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.Name = "cbFreshrate";
//
// lbFreshrate
@ -560,9 +562,9 @@
//
// tabPage9
//
resources.ApplyResources(this.tabPage9, "tabPage9");
this.tabPage9.Controls.Add(this.txtuserPacRule);
this.tabPage9.Controls.Add(this.panel4);
resources.ApplyResources(this.tabPage9, "tabPage9");
this.tabPage9.Name = "tabPage9";
this.tabPage9.UseVisualStyleBackColor = true;
//
@ -573,21 +575,21 @@
//
// panel4
//
this.panel4.Controls.Add(this.label4);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.label4);
this.panel4.Name = "panel4";
//
// label4
//
this.label4.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.label4, "label4");
this.label4.ForeColor = System.Drawing.Color.Brown;
this.label4.Name = "label4";
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// btnOK

File diff suppressed because it is too large Load diff

View file

@ -131,16 +131,22 @@
<value>关闭Http代理</value>
</data>
<data name="cmblistenerType.Items1" xml:space="preserve">
<value>开启Http代理,并自动配置代理服务器(全局模式)</value>
<value>开启Http代理,并自动配置系统代理(全局模式)</value>
</data>
<data name="cmblistenerType.Items2" xml:space="preserve">
<value>开启PAC,并自动配置PAC(PAC模式)</value>
<value>开启PAC,并自动配置系统代理(PAC模式)</value>
</data>
<data name="cmblistenerType.Items3" xml:space="preserve">
<value>仅开启Http代理,不自动配置代理服务器(直连模式)</value>
<value>仅开启Http代理,并清除系统代理</value>
</data>
<data name="cmblistenerType.Items4" xml:space="preserve">
<value>仅开启PAC,不自动配置PAC</value>
<value>仅开启PAC,并清除系统代理</value>
</data>
<data name="cmblistenerType.Items5" xml:space="preserve">
<value>仅开启Http代理,不改变系统代理</value>
</data>
<data name="cmblistenerType.Items6" xml:space="preserve">
<value>仅开启PAC,不改变系统代理</value>
</data>
<data name="chksniffingEnabled2.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 16</value>

View file

@ -42,7 +42,7 @@ namespace v2rayN.Handler
var index = config.listenerType;
if (index > 0)
{
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange })[index - 1];
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange, Color.DarkSlateBlue, Color.RoyalBlue })[index - 1];
//color = ColorTranslator.FromHtml(new string[] { "#CC0066", "#CC6600", "#99CC99", "#666699" }[index - 1]);
}
@ -150,6 +150,6 @@ namespace v2rayN.Handler
}
}
}
}

View file

@ -1,156 +1,170 @@
using System;
using v2rayN.Mode;
namespace v2rayN.HttpProxyHandler
{
/// <summary>
/// 系统代理(http)总处理
/// 启动privoxy提供http协议
/// 设置IE系统代理或者PAC模式
/// </summary>
class HttpProxyHandle
{
private static bool Update(Config config, bool forceDisable)
{
int type = config.listenerType;
if (forceDisable)
{
type = 0;
}
try
{
if (type != 0)
{
var port = Global.httpPort;
if (port <= 0)
{
return false;
}
if (type == 1)
{
//PACServerHandle.Stop();
ProxySetting.SetProxy($"{Global.Loopback}:{port}", Global.IEProxyExceptions, 2);
}
else if (type == 2)
{
string pacUrl = GetPacUrl();
ProxySetting.SetProxy(pacUrl, "", 4);
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
else if (type == 3)
{
//PACServerHandle.Stop();
ProxySetting.UnsetProxy();
}
else if (type == 4)
{
string pacUrl = GetPacUrl();
ProxySetting.UnsetProxy();
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
}
else
{
ProxySetting.UnsetProxy();
//PACServerHandle.Stop();
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
return true;
}
/// <summary>
/// 启用系统代理(http)
/// </summary>
/// <param name="config"></param>
private static void StartHttpAgent(Config config)
{
try
{
int localPort = config.GetLocalPort(Global.InboundSocks);
if (localPort > 0)
{
PrivoxyHandler.Instance.Restart(localPort, config);
if (PrivoxyHandler.Instance.RunningPort > 0)
{
Global.sysAgent = true;
Global.socksPort = localPort;
Global.httpPort = PrivoxyHandler.Instance.RunningPort;
Global.pacPort = config.GetLocalPort("pac");
}
}
}
catch
{
}
}
/// <summary>
/// 关闭系统代理
/// </summary>
/// <param name="config"></param>
public static void CloseHttpAgent(Config config)
{
try
{
Update(config, true);
PrivoxyHandler.Instance.Stop();
Global.sysAgent = false;
Global.socksPort = 0;
Global.httpPort = 0;
}
catch
{
}
}
/// <summary>
/// 重启系统代理(http)
/// </summary>
/// <param name="config"></param>
/// <param name="forced"></param>
public static void RestartHttpAgent(Config config, bool forced)
{
bool isRestart = false;
using System;
using v2rayN.Mode;
namespace v2rayN.HttpProxyHandler
{
/// <summary>
/// 系统代理(http)总处理
/// 启动privoxy提供http协议
/// 设置IE系统代理或者PAC模式
/// </summary>
class HttpProxyHandle
{
private static bool Update(Config config, bool forceDisable)
{
int type = config.listenerType;
if (forceDisable)
{
type = 0;
}
try
{
if (type != 0)
{
var port = Global.httpPort;
if (port <= 0)
{
return false;
}
if (type == 1)
{
//PACServerHandle.Stop();
//ProxySetting.SetProxy($"{Global.Loopback}:{port}", Global.IEProxyExceptions, 2);
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}");
}
else if (type == 2)
{
string pacUrl = GetPacUrl();
//ProxySetting.SetProxy(pacUrl, "", 4);
SysProxyHandle.SetIEProxy(true, false, pacUrl);
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
else if (type == 3)
{
//PACServerHandle.Stop();
SysProxyHandle.ResetIEProxy();
}
else if (type == 4)
{
string pacUrl = GetPacUrl();
SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
else if (type == 5)
{
//PACServerHandle.Stop();
//SysProxyHandle.ResetIEProxy();
}
else if (type == 6)
{
string pacUrl = GetPacUrl();
//SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
}
else
{
SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
return true;
}
/// <summary>
/// 启用系统代理(http)
/// </summary>
/// <param name="config"></param>
private static void StartHttpAgent(Config config)
{
try
{
int localPort = config.GetLocalPort(Global.InboundSocks);
if (localPort > 0)
{
PrivoxyHandler.Instance.Restart(localPort, config);
if (PrivoxyHandler.Instance.RunningPort > 0)
{
Global.sysAgent = true;
Global.socksPort = localPort;
Global.httpPort = PrivoxyHandler.Instance.RunningPort;
Global.pacPort = config.GetLocalPort("pac");
}
}
}
catch
{
}
}
/// <summary>
/// 关闭系统代理
/// </summary>
/// <param name="config"></param>
public static void CloseHttpAgent(Config config)
{
try
{
Update(config, true);
PrivoxyHandler.Instance.Stop();
Global.sysAgent = false;
Global.socksPort = 0;
Global.httpPort = 0;
}
catch
{
}
}
/// <summary>
/// 重启系统代理(http)
/// </summary>
/// <param name="config"></param>
/// <param name="forced"></param>
public static void RestartHttpAgent(Config config, bool forced)
{
bool isRestart = false;
if (config.listenerType == 0)
{
// 关闭http proxy时直接返回
return;
}
//强制重启或者socks端口变化
if (forced)
{
isRestart = true;
}
else
{
int localPort = config.GetLocalPort(Global.InboundSocks);
if (localPort != Global.socksPort)
{
isRestart = true;
}
}
if (isRestart)
{
CloseHttpAgent(config);
StartHttpAgent(config);
}
Update(config, false);
}
public static string GetPacUrl()
{
string pacUrl = $"http://{Global.Loopback}:{Global.pacPort}/pac/?t={ DateTime.Now.ToString("HHmmss")}";
return pacUrl;
}
}
}
}
//强制重启或者socks端口变化
if (forced)
{
isRestart = true;
}
else
{
int localPort = config.GetLocalPort(Global.InboundSocks);
if (localPort != Global.socksPort)
{
isRestart = true;
}
}
if (isRestart)
{
CloseHttpAgent(config);
StartHttpAgent(config);
}
Update(config, false);
}
public static string GetPacUrl()
{
string pacUrl = $"http://{Global.Loopback}:{Global.pacPort}/pac/?t={ DateTime.Now.ToString("HHmmss")}";
return pacUrl;
}
}
}

View file

@ -0,0 +1,193 @@

using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
using v2rayN.Base;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.Tool;
namespace v2rayN.HttpProxyHandler
{
public static class SysProxyHandle
{
//private const string _userWininetConfigFile = "user-wininet.json";
//private static string _queryStr;
// In general, this won't change
// format:
// <flags><CR-LF>
// <proxy-server><CR-LF>
// <bypass-list><CR-LF>
// <pac-url>
private static SysproxyConfig _userSettings = null;
enum RET_ERRORS : int
{
RET_NO_ERROR = 0,
INVALID_FORMAT = 1,
NO_PERMISSION = 2,
SYSCALL_FAILED = 3,
NO_MEMORY = 4,
INVAILD_OPTION_COUNT = 5,
};
static SysProxyHandle()
{
try
{
FileManager.UncompressFile(Utils.GetTempPath("sysproxy.exe"),
Environment.Is64BitOperatingSystem ? Resources.sysproxy64_exe : Resources.sysproxy_exe);
}
catch (IOException ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
public static void SetIEProxy(bool enable, bool global, string strProxy)
{
//Read();
//if (!_userSettings.UserSettingsRecorded)
//{
// // record user settings
// ExecSysproxy("query");
// //ParseQueryStr(_queryStr);
//}
string arguments;
if (enable)
{
arguments = global
? $"global {strProxy} {Global.IEProxyExceptions}"
: $"pac {strProxy}";
}
else
{
// restore user settings
var flags = _userSettings.Flags;
var proxy_server = _userSettings.ProxyServer ?? "-";
var bypass_list = _userSettings.BypassList ?? "-";
var pac_url = _userSettings.PacUrl ?? "-";
arguments = $"set {flags} {proxy_server} {bypass_list} {pac_url}";
// have to get new settings
_userSettings.UserSettingsRecorded = false;
}
//Save();
ExecSysproxy(arguments);
}
// set system proxy to 1 (null) (null) (null)
public static bool ResetIEProxy()
{
try
{
// clear user-wininet.json
//_userSettings = new SysproxyConfig();
//Save();
// clear system setting
ExecSysproxy("set 1 - - -");
}
catch (Exception)
{
return false;
}
return true;
}
private static void ExecSysproxy(string arguments)
{
// using event to avoid hanging when redirect standard output/error
// ref: https://stackoverflow.com/questions/139593/processstartinfo-hanging-on-waitforexit-why
// and http://blog.csdn.net/zhangweixing0/article/details/7356841
using (AutoResetEvent outputWaitHandle = new AutoResetEvent(false))
using (AutoResetEvent errorWaitHandle = new AutoResetEvent(false))
{
using (var process = new Process())
{
// Configure the process using the StartInfo properties.
process.StartInfo.FileName = Utils.GetTempPath("sysproxy.exe");
process.StartInfo.Arguments = arguments;
process.StartInfo.WorkingDirectory = Utils.GetTempPath();
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
// Need to provide encoding info, or output/error strings we got will be wrong.
process.StartInfo.StandardOutputEncoding = Encoding.Unicode;
process.StartInfo.StandardErrorEncoding = Encoding.Unicode;
process.StartInfo.CreateNoWindow = true;
StringBuilder output = new StringBuilder();
StringBuilder error = new StringBuilder();
process.OutputDataReceived += (sender, e) =>
{
if (e.Data == null)
{
outputWaitHandle.Set();
}
else
{
output.AppendLine(e.Data);
}
};
process.ErrorDataReceived += (sender, e) =>
{
if (e.Data == null)
{
errorWaitHandle.Set();
}
else
{
error.AppendLine(e.Data);
}
};
try
{
process.Start();
process.BeginErrorReadLine();
process.BeginOutputReadLine();
process.WaitForExit();
}
catch (System.ComponentModel.Win32Exception e)
{
// log the arguments
throw new Exception(process.StartInfo.Arguments);
}
var stderr = error.ToString();
var stdout = output.ToString();
var exitCode = process.ExitCode;
if (exitCode != (int)RET_ERRORS.RET_NO_ERROR)
{
throw new Exception(stderr);
}
//if (arguments == "query")
//{
// if (stdout.IsNullOrWhiteSpace() || stdout.IsNullOrEmpty())
// {
// throw new Exception("failed to query wininet settings");
// }
// _queryStr = stdout;
//}
}
}
}
}
}

View file

@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("v2rayN")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2019")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
// 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("3.7")]
[assembly: AssemblyFileVersion("3.8")]

View file

@ -216,5 +216,25 @@ namespace v2rayN.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] sysproxy_exe {
get {
object obj = ResourceManager.GetObject("sysproxy_exe", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] sysproxy64_exe {
get {
object obj = ResourceManager.GetObject("sysproxy64_exe", resourceCulture);
return ((byte[])(obj));
}
}
}
}

View file

@ -163,4 +163,10 @@
<data name="sub" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\sub.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sysproxy64_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\sysproxy64.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="sysproxy_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\sysproxy.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

Binary file not shown.

Binary file not shown.

View file

@ -195,6 +195,7 @@
<Compile Include="Base\WebClientEx.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="HttpProxyHandler\SysProxyHandle.cs" />
<Compile Include="Mode\EMove.cs" />
<Compile Include="Mode\ServerStatistics.cs" />
<Compile Include="Mode\SysproxyConfig.cs" />
@ -345,6 +346,8 @@
<EmbeddedResource Include="Sample\custom_routing_block" />
<EmbeddedResource Include="Sample\custom_routing_direct" />
<EmbeddedResource Include="Sample\custom_routing_proxy" />
<None Include="Resources\sysproxy.exe.gz" />
<None Include="Resources\sysproxy64.exe.gz" />
<Protobuf Include="Protos\Statistics.proto" />
<None Include="Resources\abp.js.gz" />
<None Include="Resources\pac.txt.gz" />