From c720ef756b53e17d3b0e213205a3cb0dd15a6021 Mon Sep 17 00:00:00 2001 From: a90120411 Date: Sun, 14 Jun 2020 22:42:14 +0800 Subject: [PATCH] Add hotkey setting option. --- v2rayN/v2rayN/Forms/MainForm.Designer.cs | 9 + v2rayN/v2rayN/Forms/MainForm.cs | 36 + v2rayN/v2rayN/Forms/MainForm.resx | 14 +- v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx | 6 + .../Forms/OptionSettingForm.Designer.cs | 101 + v2rayN/v2rayN/Forms/OptionSettingForm.cs | 123 + v2rayN/v2rayN/Forms/OptionSettingForm.resx | 3935 +++++++++-------- .../Forms/OptionSettingForm.zh-Hans.resx | 51 + .../Forms/QuicklyAddUserPACForm.Designer.cs | 89 + v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.cs | 56 + .../v2rayN/Forms/QuicklyAddUserPACForm.resx | 249 ++ .../Forms/QuicklyAddUserPACForm.zh-Hans.resx | 143 + v2rayN/v2rayN/Handler/ConfigHandler.cs | 4 + .../v2rayN/Handler/Hotkey/HotkeyCallbacks.cs | 82 + v2rayN/v2rayN/Handler/Hotkey/HotkeyReg.cs | 82 + v2rayN/v2rayN/Handler/Hotkey/Hotkeys.cs | 175 + v2rayN/v2rayN/Handler/V2rayHandler.cs | 25 +- v2rayN/v2rayN/Mode/Config.cs | 42 + v2rayN/v2rayN/Properties/AssemblyInfo.cs | 2 +- v2rayN/v2rayN/Resx/ResUI.Designer.cs | 18 + v2rayN/v2rayN/Resx/ResUI.resx | 6 + v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx | 6 + v2rayN/v2rayN/v2rayN.csproj | 19 + 23 files changed, 3424 insertions(+), 1849 deletions(-) create mode 100644 v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.Designer.cs create mode 100644 v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.cs create mode 100644 v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.resx create mode 100644 v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.zh-Hans.resx create mode 100644 v2rayN/v2rayN/Handler/Hotkey/HotkeyCallbacks.cs create mode 100644 v2rayN/v2rayN/Handler/Hotkey/HotkeyReg.cs create mode 100644 v2rayN/v2rayN/Handler/Hotkey/Hotkeys.cs diff --git a/v2rayN/v2rayN/Forms/MainForm.Designer.cs b/v2rayN/v2rayN/Forms/MainForm.Designer.cs index 7ec70cfe..31351b30 100644 --- a/v2rayN/v2rayN/Forms/MainForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/MainForm.Designer.cs @@ -78,6 +78,7 @@ this.menuScanScreen2 = new System.Windows.Forms.ToolStripMenuItem(); this.menuCopyPACUrl = new System.Windows.Forms.ToolStripMenuItem(); this.menuUpdateSubscriptions = new System.Windows.Forms.ToolStripMenuItem(); + this.menuQuicklyAddUserPAC = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.menuExit = new System.Windows.Forms.ToolStripMenuItem(); this.bgwScan = new System.ComponentModel.BackgroundWorker(); @@ -400,6 +401,7 @@ this.menuScanScreen2, this.menuCopyPACUrl, this.menuUpdateSubscriptions, + this.menuQuicklyAddUserPAC, this.toolStripSeparator2, this.menuExit}); this.cmsMain.Name = "contextMenuStrip1"; @@ -491,6 +493,12 @@ resources.ApplyResources(this.menuUpdateSubscriptions, "menuUpdateSubscriptions"); this.menuUpdateSubscriptions.Click += new System.EventHandler(this.menuUpdateSubscriptions_Click); // + // menuQuicklyAddUserPAC + // + this.menuQuicklyAddUserPAC.Name = "menuQuicklyAddUserPAC"; + resources.ApplyResources(this.menuQuicklyAddUserPAC, "menuQuicklyAddUserPAC"); + this.menuQuicklyAddUserPAC.Click += new System.EventHandler(this.menuQuicklyAddUserPAC_Click); + // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; @@ -936,6 +944,7 @@ private System.Windows.Forms.ToolStripMenuItem tsbTestMe; private System.Windows.Forms.ToolStripButton tsbReload; private System.Windows.Forms.ToolStripButton tsbQRCodeSwitch; + private System.Windows.Forms.ToolStripMenuItem menuQuicklyAddUserPAC; } } diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index bf61cc5b..8ca0d4d7 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -11,6 +11,7 @@ using v2rayN.Tool; using System.Diagnostics; using System.Drawing; using System.Net; +using v2rayN.Handler.Hotkey; namespace v2rayN.Forms { @@ -19,6 +20,7 @@ namespace v2rayN.Forms private V2rayHandler v2rayHandler; private List lvSelecteds = new List(); private StatisticsHandler statistics = null; + private QuicklyAddUserPACForm fmQuickAddUserPAC; #region Window 事件 @@ -49,6 +51,18 @@ namespace v2rayN.Forms ConfigHandler.LoadConfig(ref config); v2rayHandler = new V2rayHandler(); v2rayHandler.ProcessEvent += v2rayHandler_ProcessEvent; + + v2rayHandler.StopProxyEvent += this.menuNotEnabledHttp_Click; + v2rayHandler.StartGlobalProxyModeEvent += this.menuGlobal_Click; + v2rayHandler.StartPACProxyModeEvent += this.menuGlobalPAC_Click; + v2rayHandler.ShowAddUserPACEvent += this.menuQuicklyAddUserPAC_Click; + + Hotkeys.Init(v2rayHandler); + + if (config.hotkeyConfig.regHotkeyAtStartup) + { + HotkeyReg.RegAllHotkeys(config.hotkeyConfig); + } if (config.enableStatistics) { @@ -1217,6 +1231,28 @@ namespace v2rayN.Forms { SetListenerType(ListenerType.PacOpenOnly); } + private void menuQuicklyAddUserPAC_Click(object sender, EventArgs e) + { + if (fmQuickAddUserPAC == null) + { + fmQuickAddUserPAC = new QuicklyAddUserPACForm(); + } + + if (fmQuickAddUserPAC.Visible == false) + { + fmQuickAddUserPAC.ShowDialog(); + } + else + { + fmQuickAddUserPAC.Activate(); + } + + if (fmQuickAddUserPAC.DialogResult == DialogResult.OK) + { + //刷新 + LoadV2ray(); + } + } private void SetListenerType(ListenerType type) { config.listenerType = type; diff --git a/v2rayN/v2rayN/Forms/MainForm.resx b/v2rayN/v2rayN/Forms/MainForm.resx index 82105967..b0ceb16c 100644 --- a/v2rayN/v2rayN/Forms/MainForm.resx +++ b/v2rayN/v2rayN/Forms/MainForm.resx @@ -506,6 +506,12 @@ Update subscriptions + + 264, 22 + + + Quickly add user PAC rule + 261, 6 @@ -516,7 +522,7 @@ Exit - 265, 164 + 265, 208 cmsMain @@ -1250,6 +1256,12 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + menuQuicklyAddUserPAC + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + toolStripSeparator2 diff --git a/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx index 21164412..f0fc58b3 100644 --- a/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx @@ -372,6 +372,12 @@ 更新订阅 + + 195, 22 + + + 添加一条用户PAC规则 + 192, 6 diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs index 62af6048..8d4f102a 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs @@ -97,6 +97,16 @@ this.txtuserPacRule = new System.Windows.Forms.TextBox(); this.panel4 = new System.Windows.Forms.Panel(); this.label4 = new System.Windows.Forms.Label(); + this.tabPage10 = new System.Windows.Forms.TabPage(); + this.chkRegHotkeyAtStartup = new System.Windows.Forms.CheckBox(); + this.txtHotkeyAddUserPAC = new System.Windows.Forms.TextBox(); + this.lblHotkeyAddUserPAC = new System.Windows.Forms.Label(); + this.txtHotkeyPACProxyMode = new System.Windows.Forms.TextBox(); + this.lblHotkeyPACProxyMode = new System.Windows.Forms.Label(); + this.txtHotkeyGlobalProxyMode = new System.Windows.Forms.TextBox(); + this.lblHotkeyGlobalProxyMode = new System.Windows.Forms.Label(); + this.txtHotkeyStopProxy = new System.Windows.Forms.TextBox(); + this.lblHotkeyStopProxy = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); this.btnOK = new System.Windows.Forms.Button(); this.panel1 = new System.Windows.Forms.Panel(); @@ -115,6 +125,7 @@ this.tabPage7.SuspendLayout(); this.tabPage9.SuspendLayout(); this.panel4.SuspendLayout(); + this.tabPage10.SuspendLayout(); this.panel2.SuspendLayout(); this.SuspendLayout(); // @@ -134,6 +145,7 @@ this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage9); + this.tabControl1.Controls.Add(this.tabPage10); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; // @@ -603,6 +615,83 @@ this.label4.ForeColor = System.Drawing.Color.Brown; this.label4.Name = "label4"; // + // tabPage10 + // + resources.ApplyResources(this.tabPage10, "tabPage10"); + this.tabPage10.Controls.Add(this.chkRegHotkeyAtStartup); + this.tabPage10.Controls.Add(this.txtHotkeyAddUserPAC); + this.tabPage10.Controls.Add(this.lblHotkeyAddUserPAC); + this.tabPage10.Controls.Add(this.txtHotkeyPACProxyMode); + this.tabPage10.Controls.Add(this.lblHotkeyPACProxyMode); + this.tabPage10.Controls.Add(this.txtHotkeyGlobalProxyMode); + this.tabPage10.Controls.Add(this.lblHotkeyGlobalProxyMode); + this.tabPage10.Controls.Add(this.txtHotkeyStopProxy); + this.tabPage10.Controls.Add(this.lblHotkeyStopProxy); + this.tabPage10.Name = "tabPage10"; + this.tabPage10.UseVisualStyleBackColor = true; + // + // chkRegHotkeyAtStartup + // + resources.ApplyResources(this.chkRegHotkeyAtStartup, "chkRegHotkeyAtStartup"); + this.chkRegHotkeyAtStartup.Name = "chkRegHotkeyAtStartup"; + this.chkRegHotkeyAtStartup.UseVisualStyleBackColor = true; + // + // txtHotkeyAddUserPAC + // + resources.ApplyResources(this.txtHotkeyAddUserPAC, "txtHotkeyAddUserPAC"); + this.txtHotkeyAddUserPAC.BackColor = System.Drawing.SystemColors.Window; + this.txtHotkeyAddUserPAC.Name = "txtHotkeyAddUserPAC"; + this.txtHotkeyAddUserPAC.ReadOnly = true; + this.txtHotkeyAddUserPAC.KeyDown += new System.Windows.Forms.KeyEventHandler(this.HotkeyDown); + this.txtHotkeyAddUserPAC.KeyUp += new System.Windows.Forms.KeyEventHandler(this.HotkeyUp); + // + // lblHotkeyAddUserPAC + // + resources.ApplyResources(this.lblHotkeyAddUserPAC, "lblHotkeyAddUserPAC"); + this.lblHotkeyAddUserPAC.Name = "lblHotkeyAddUserPAC"; + // + // txtHotkeyPACProxyMode + // + resources.ApplyResources(this.txtHotkeyPACProxyMode, "txtHotkeyPACProxyMode"); + this.txtHotkeyPACProxyMode.BackColor = System.Drawing.SystemColors.Window; + this.txtHotkeyPACProxyMode.Name = "txtHotkeyPACProxyMode"; + this.txtHotkeyPACProxyMode.ReadOnly = true; + this.txtHotkeyPACProxyMode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.HotkeyDown); + this.txtHotkeyPACProxyMode.KeyUp += new System.Windows.Forms.KeyEventHandler(this.HotkeyUp); + // + // lblHotkeyPACProxyMode + // + resources.ApplyResources(this.lblHotkeyPACProxyMode, "lblHotkeyPACProxyMode"); + this.lblHotkeyPACProxyMode.Name = "lblHotkeyPACProxyMode"; + // + // txtHotkeyGlobalProxyMode + // + resources.ApplyResources(this.txtHotkeyGlobalProxyMode, "txtHotkeyGlobalProxyMode"); + this.txtHotkeyGlobalProxyMode.BackColor = System.Drawing.SystemColors.Window; + this.txtHotkeyGlobalProxyMode.Name = "txtHotkeyGlobalProxyMode"; + this.txtHotkeyGlobalProxyMode.ReadOnly = true; + this.txtHotkeyGlobalProxyMode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.HotkeyDown); + this.txtHotkeyGlobalProxyMode.KeyUp += new System.Windows.Forms.KeyEventHandler(this.HotkeyUp); + // + // lblHotkeyGlobalProxyMode + // + resources.ApplyResources(this.lblHotkeyGlobalProxyMode, "lblHotkeyGlobalProxyMode"); + this.lblHotkeyGlobalProxyMode.Name = "lblHotkeyGlobalProxyMode"; + // + // txtHotkeyStopProxy + // + resources.ApplyResources(this.txtHotkeyStopProxy, "txtHotkeyStopProxy"); + this.txtHotkeyStopProxy.BackColor = System.Drawing.SystemColors.Window; + this.txtHotkeyStopProxy.Name = "txtHotkeyStopProxy"; + this.txtHotkeyStopProxy.ReadOnly = true; + this.txtHotkeyStopProxy.KeyDown += new System.Windows.Forms.KeyEventHandler(this.HotkeyDown); + this.txtHotkeyStopProxy.KeyUp += new System.Windows.Forms.KeyEventHandler(this.HotkeyUp); + // + // lblHotkeyStopProxy + // + resources.ApplyResources(this.lblHotkeyStopProxy, "lblHotkeyStopProxy"); + this.lblHotkeyStopProxy.Name = "lblHotkeyStopProxy"; + // // panel2 // resources.ApplyResources(this.panel2, "panel2"); @@ -656,6 +745,8 @@ this.tabPage9.ResumeLayout(false); this.tabPage9.PerformLayout(); this.panel4.ResumeLayout(false); + this.tabPage10.ResumeLayout(false); + this.tabPage10.PerformLayout(); this.panel2.ResumeLayout(false); this.ResumeLayout(false); @@ -734,5 +825,15 @@ private System.Windows.Forms.CheckBox chkKeepOlderDedupl; private System.Windows.Forms.LinkLabel linkLabelRoutingDoc; private System.Windows.Forms.CheckBox chkdefAllowInsecure; + private System.Windows.Forms.TabPage tabPage10; + private System.Windows.Forms.TextBox txtHotkeyAddUserPAC; + private System.Windows.Forms.Label lblHotkeyAddUserPAC; + private System.Windows.Forms.TextBox txtHotkeyPACProxyMode; + private System.Windows.Forms.Label lblHotkeyPACProxyMode; + private System.Windows.Forms.TextBox txtHotkeyGlobalProxyMode; + private System.Windows.Forms.Label lblHotkeyGlobalProxyMode; + private System.Windows.Forms.TextBox txtHotkeyStopProxy; + private System.Windows.Forms.Label lblHotkeyStopProxy; + private System.Windows.Forms.CheckBox chkRegHotkeyAtStartup; } } \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.cs index bbfec412..04156ad0 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.cs @@ -4,6 +4,10 @@ using System.Windows.Forms; using v2rayN.Handler; using v2rayN.Base; using v2rayN.HttpProxyHandler; +using System.Text; +using static v2rayN.Handler.Hotkey.HotkeyReg; +using v2rayN.Handler.Hotkey; +using System.Drawing; namespace v2rayN.Forms { @@ -25,6 +29,8 @@ namespace v2rayN.Forms InitGUI(); InitUserPAC(); + + InitHotkey(); } /// @@ -151,6 +157,15 @@ namespace v2rayN.Forms txtuserPacRule.Text = Utils.List2String(config.userPacRule, true); } + private void InitHotkey() + { + txtHotkeyStopProxy.Text = config.hotkeyConfig.stopProxy; + txtHotkeyGlobalProxyMode.Text = config.hotkeyConfig.globalProxyMode; + txtHotkeyPACProxyMode.Text = config.hotkeyConfig.pacProxyMode; + txtHotkeyAddUserPAC.Text = config.hotkeyConfig.addUserPAC; + chkRegHotkeyAtStartup.Checked = config.hotkeyConfig.regHotkeyAtStartup; + } + private void btnOK_Click(object sender, EventArgs e) { if (SaveBase() != 0) @@ -178,6 +193,11 @@ namespace v2rayN.Forms return; } + if (SaveHotkey() != 0) + { + return; + } + if (ConfigHandler.SaveConfig(ref config) == 0) { this.DialogResult = DialogResult.OK; @@ -371,6 +391,23 @@ namespace v2rayN.Forms return 0; } + + private int SaveHotkey() + { + if (!RegisterAllHotkeys()) + { + return -1; + } + + config.hotkeyConfig.stopProxy = txtHotkeyStopProxy.Text; + config.hotkeyConfig.globalProxyMode = txtHotkeyGlobalProxyMode.Text; + config.hotkeyConfig.pacProxyMode = txtHotkeyPACProxyMode.Text; + config.hotkeyConfig.addUserPAC = txtHotkeyAddUserPAC.Text; + config.hotkeyConfig.regHotkeyAtStartup = chkRegHotkeyAtStartup.Checked; + + return 0; + } + private void btnClose_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; @@ -446,6 +483,92 @@ namespace v2rayN.Forms { System.Diagnostics.Process.Start("https://www.v2fly.org/chapter_02/03_routing.html"); } + + /// + /// Capture hotkey - Press key + /// + private void HotkeyDown(object sender, KeyEventArgs e) + { + StringBuilder sb = new StringBuilder(); + //Combination key only + if (e.Modifiers != 0) + { + // XXX: Hotkey parsing depends on the sequence, more specifically, ModifierKeysConverter. + // Windows key is reserved by operating system, we deny this key. + if (e.Control) + { + sb.Append("Ctrl+"); + } + if (e.Alt) + { + sb.Append("Alt+"); + } + if (e.Shift) + { + sb.Append("Shift+"); + } + + Keys keyvalue = (Keys)e.KeyValue; + if ((keyvalue >= Keys.PageUp && keyvalue <= Keys.Down) || + (keyvalue >= Keys.A && keyvalue <= Keys.Z) || + (keyvalue >= Keys.F1 && keyvalue <= Keys.F12)) + { + sb.Append(e.KeyCode); + } + else if (keyvalue >= Keys.D0 && keyvalue <= Keys.D9) + { + sb.Append('D').Append((char)e.KeyValue); + } + else if (keyvalue >= Keys.NumPad0 && keyvalue <= Keys.NumPad9) + { + sb.Append("NumPad").Append((char)(e.KeyValue - 48)); + } + } + ((TextBox)sender).Text = sb.ToString(); + } + + /// + /// Capture hotkey - Release key + /// + private void HotkeyUp(object sender, KeyEventArgs e) + { + var tb = (TextBox)sender; + var content = tb.Text.TrimEnd(); + if (content.Length >= 1 && content[content.Length - 1] == '+') + { + tb.Text = ""; + } + } + + private bool RegisterAllHotkeys() + { + return + RegHotkeyFromString(txtHotkeyStopProxy.Text, "StopProxyCallback", result => HandleRegResult(txtHotkeyStopProxy.Text, lblHotkeyStopProxy, result)) + && RegHotkeyFromString(txtHotkeyGlobalProxyMode.Text, "GlobalProxyModeCallback", result => HandleRegResult(txtHotkeyGlobalProxyMode.Text, lblHotkeyGlobalProxyMode, result)) + && RegHotkeyFromString(txtHotkeyPACProxyMode.Text, "PACProxyModeCallback", result => HandleRegResult(txtHotkeyPACProxyMode.Text, lblHotkeyPACProxyMode, result)) + && RegHotkeyFromString(txtHotkeyAddUserPAC.Text, "AddUserPACCallback", result => HandleRegResult(txtHotkeyAddUserPAC.Text, lblHotkeyAddUserPAC, result)); + } + + private void HandleRegResult(string hotkeyStr, Label label, HotkeyReg.RegResult result) + { + switch (result) + { + case RegResult.ParseError: + UI.ShowWarning(string.Format(UIRes.I18N("HotkeyParseFailed"), hotkeyStr)); + break; + case RegResult.UnregSuccess: + label.ResetBackColor(); + break; + case RegResult.RegSuccess: + label.BackColor = Color.Green; + break; + case RegResult.RegFailure: + label.BackColor = Color.Red; + break; + default: + break; + } + } } class ComboItem diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.resx index 2d85641a..4021f748 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.resx @@ -118,1954 +118,2197 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 11 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 2 - - - - 30, 176 - - - Record local logs - - - 634, 460 - - + 12 - - 4, 22 - - - txtKcpwriteBufferSize - - - txtuserPacRule - - - 2 - - - False - - - 18 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControl1 - - - groupBox1 - - - 5 - - - 94, 21 - - - 9 - - - groupBox1 - - - tabPage9 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - linkLabelRoutingDoc - - - 468, 60 - - - - Top - - - 102, 16 - - - 6 - - - txtKcptti - - - tabPage3 + + tabPage6 + 4, 22 - - cmblistenerType - - - 0 - - - 634, 460 - - - 0 - - - 111, 100 - - - True - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3, 3 - - - 598, 16 - - - Core: basic settings - - - True - - - 120, 16 - - - 281, 12 - - - panel3 - - - True - - - tti - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 84, 16 - - - groupBox1 - - - 65, 12 - - - 628, 454 - - - tabPage7 - - - Only open PAC, do not automatically configure PAC - - - 12 - - - 662, 60 - - - 20 - - - http - - - 7 - - - chkdefAllowInsecure - - - 648, 573 - - - 206, 64 - - - 95, 12 - - - tabPage6 - - - 14 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 15, 63 - - - tabControl2 - - - 16 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - Enable UDP - - - 94, 21 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - &Cancel - - - label10 - - - 648, 573 - - - Vertical - - + groupBox1 System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 - - - 1 - - - Bypassing the LAN address - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Bypassing LAN and mainland address - - - Bypass mainland address - - - Top - - - 12 - - - txtKcpmtu - - - lbFreshrate - - - 1 - - - label11 - - - 29 - - - 1 - - - NoControl - - - Turn on Sniffing - - - Only open Http proxy, do not automatically configure proxy server (direct mode) - - - False - - - 4 - - - tabPage6 - - - False - - - tabControl2 - - - 1 - - - $this - - - 7 - - - 3 - - - 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - readBufferSize - - - 0 - - - tabPage6 - - - 3 - - - True - - - 18 - - - True - - - Fill - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - congestion - - - NoControl - - - groupBox1 - - - panel3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3, 3, 3, 3 - - - 89, 12 - - - info - - - txtUseragent - - - 1 - - - tabPage7 - - - v2rayN settings - - - 20 - - - groupBox1 - - - 16 - - - Not Enabled Http Proxy - - - 14 - - - 32 - - - 628, 454 - - - 6, 12 - - - groupBox1 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - txtKcpdownlinkCapacity - - - 198, 16 - - - Automatically start at system startup - - - 3, 3, 3, 3 - - - 1 - - - Http proxy - - - 4 - - - groupBox1 - - - tabPage6 - - - 355, 16 - - - 3, 3, 3, 3 - - - 97, 20 - - - 3 - - - 662, 605 - - - 33, 29 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 78, 21 - - - 5, 45 - - - Custom DNS (multiple, separated by commas (,)) - - - tabControl1 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 598, 16 - - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - warning - - - groupBox1 - - - 0 - - - tabPage7 - - - Statistics freshrate - - - label5 - - - 120, 16 - - - 20 - - - 89, 12 - - - Only open Http proxy and do nothing - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 18, 66 - - - 20, 143 - - - 11 - - - 4, 4, 4, 4 - - - tabPage6 - - - btnClose - - - Turn on Sniffing - - - groupBox1 - - - 18, 28 - - - 30 - - - 34 - - - 20 - - - 29 - - - 0 - - - 21, 17 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 14 - - - 19 - - - 4, 22 - - - *Set user pac rules, separated by commas (,) - - - True - - - chksniffingEnabled - - + 6 - - 174, 16 - - - 16 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 18, 104 - - - tabPage2 - - - NoControl - - - 97, 20 - - - socks - - - tabPage5 - - - 576, 16 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 464, 20 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage9 - - - True - - - tabPage6 - - - *Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP - - - tabPage3 - - - 30 - - - 53, 12 - - - 17 - - - label8 - - - 468, 27 - - - label13 - - - chkAutoRun - - - tabControl2 - - - 654, 579 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 345, 62 - - - 15 - - - 12 - - - 1 - - - chkudpEnabled - - - True - - - 33, 253 - - - tabPage1 - - - 5 - - - tabPage6 - - - 2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 5 - - - btnSetDefRountingRule - - - True - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 32 - - - label1 - - - 84, 16 - - - tabPage8 - - - True - - - panel4 - - - label7 - - - allowInsecure - - - txtlocalPort - - - True - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage7 - - - 3, 17 - - - 3, 40 - - - labRoutingTips - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3, 3, 3, 3 - - - 124, 25 - - - protocol - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControl2 - - - Top, Right - - - Turn on Mux Multiplexing - - - True - - - 23, 12 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 555, 100 - - - socks - - - 0 - - - 3, 3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - chkAllowLANConn - - - 84, 16 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControl1 - - - tabControl1 - - - True - - - tabPage6 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 15, 38 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3 - - - 10 - - - 369, 62 - - - 13 - - - 1.Proxy Domain or IP - - - groupBox1 - - - panel3 - - - NoControl - - - 654, 579 - - - chkEnableStatistics - - - 14 - - - 8 - - - 7 - - - http - - - 53, 12 - - - 193, 162 - - - True - - - 2 - - - 0 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - label2 - - - 165, 20 - - - False - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - 3, 3 - - - 9 - - - groupBox1 - - - 4.Pre-defined rules - - - 101, 12 - - - 3 - - - 12 - - - 431, 12 - - - Domain strategy - - - cmbprotocol - - - 648, 37 - - - True - - - Enable Statistics (Realtime netspeed and traffic records. Require restart the v2rayN client) - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4 - Listening port - - Vertical + + 8 - + + Fill - + + tabPage7 + + + 355, 16 + + + tabPage7 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 18 + + + error + + + 15, 129 + + + readBufferSize + + + True + + + 3, 3, 3, 3 + + + 11 + + + mtu + + 1 System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Vertical - - - 1 - - - 28 - - - 257, 60 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 94, 21 - - - True - - - cmbprotocol2 - - - Open Http proxy and automatically configure proxy server (global mode) - - - groupBox2 - - - chkKeepOlderDedupl - - - 15, 129 - - - 255, 20 - - - mtu - - - True - - - True - - - True - - - chkKcpcongestion - - - 1 - - - 0 - - - 257, 25 - - - 3, 84 - - - groupBox1 - - - Top - - - listening port 2 - - - 97, 20 - - - chkAllowIn2 - - - tabPage2 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - True - - - False - 3 - - 33 - - - 4, 22 - - - 9 - - - 541, 100 - - - Core: KCP settings - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - error - - - 15, 160 - - - True - - - 59, 12 - - - 5, 14 - - - groupBox1 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 634, 460 - - - 12 - - - 120, 16 - - - 662, 10 - - - txtlocalPort2 - - - Only open PAC and do nothing - - - True - - - Fill - - - groupBox1 - - - 654, 579 - - - 7 - - - 27 - - - 10 - - - False - - - Vertical - - - 206, 29 - - - 8 - - - txtUserdirect - - - chkudpEnabled2 - - - 0 - - - 0 - - - 648, 536 - - - Allow connections from the LAN - - - 161, 84 - - - panel3 - - - 0 - - - tabPage6 - - - tabControl2 - - - 30, 87 - - - txtKcpreadBufferSize - - - 4 - - - panel2 - - - 3 - - - 8 - - - 35 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - User PAC settings - - - 95, 12 - - - tabPage7 - - - 10 - - - none - Log level - - tabControl1 - - - protocol - - - 6 - - - tabPage4 - - - NoControl - - - 2 - - - AsIs - - - 15, 62 - - - 7 - - - tabPage7 - - - 642, 486 - - - 4, 22 - - - 58, 20 - - - groupBox1 - - - 1 - - - 42, 98 - - - 13 - - - 13 - - - 2 - - - downlinkCapacity - - - True - - - 78, 21 - - - tabPage7 - - - True - - - 19 - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - cmbroutingMode - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - 23, 12 - - - True - - - 8 - - - True - - - 3, 3, 3, 3 - - - Custom GFWList address (please fill in the blank without customization) - - - 345, 100 - - - panel3 - - - 75, 23 - - - 654, 579 - - - 10 - - - 204, 16 - - - 17 - - - 628, 454 - - - debug - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 6 - - - 1 - - - txtUserblock - - - 229, 23 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage1 - - - 15 - - - 2 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - 11 - - - 18 - - - 126, 16 - - - 345, 24 - - - NoControl - - - 4, 22 - - - cmbdomainStrategy - - - False - - - 257, 158 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - &OK - - - 10 - - - 634, 460 - - - panel2 - - - txtKcpuplinkCapacity - - - 115, 10 - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage4 - - - chklogEnabled - - - chksniffingEnabled2 - - - tabPage7 - - - 642, 67 - - - 0 - - - 4, 22 - - - True - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage5 - - - 9 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - IPIfNonMatch - - - groupBox1 - - - 4, 22 - - - 23 - - - 3.Block Domain or IP - - - label3 - - - 6 - - - 236, 66 - - - tabPage7 - - - $this - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - $this - - - 8 - - - txtremoteDNS - - - 3, 3 - - - 0, 615 - - - 19 - - - 33 - - - 94, 21 - - - 4, 22 - - - writeBufferSize - - - 11 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 89, 12 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - 31 - - - 369, 27 - - - 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - tabPage6 - - - groupBox1 - - - groupBox1 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel4 - - - True - - - 29 - - - Fill - - - True - - - 3, 3 - - - OptionSettingForm - - - 124, 94 - - - Core: Routing settings - - - 13 - - - tabPage8 - - - 2 - - - 236, 104 - - - 5 - Open PAC and automatically configure PAC (PAC mode) - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + panel4 - - NoControl + + panel1 + + + tabPage6 tabPage9 - - 94, 21 + + groupBox1 - - 75, 23 + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 15, 16 + + 4, 22 - - 33, 277 + + 35 - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 4 - - 0, 0, 0, 0 + + Enable UDP - - 662, 675 + + Top, Right - - uplinkCapacity + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - IPOnDemand - - - NoControl - - - True - - - 6 - - - 1 + + chkKeepOlderDedupl 0 - - Settings - - - 0 - - - 3, 3, 3, 3 - - - 3, 3 - - - 32, 205 - - - cmbloglevel - - - 111, 62 + + 33, 277 System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label4 + + linkLabelRoutingDoc - + + 2 + + + 257, 25 + + + 15, 16 + + + socks + + + 125, 12 + + + cbFreshrate + + + Statistics freshrate + + + 12, 19 + + + 161, 12 + + + tabPage10 + + + 0 + + + downlinkCapacity + + + listening port 2 + + + True + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + txtlocalPort + + + 84, 16 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 19 + + + tabPage6 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 2 + + + True + + + 0 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 193, 162 + + + tabPage2 + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Open Http proxy and automatically configure proxy server (global mode) + + + 206, 64 + + + 8 + + + 5 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 18 + + + 236, 66 + + + 0 + + + 18, 104 + + + 95, 12 + + + groupBox1 + + + 3 + + + 6 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 15, 62 + + + 124, 25 + + + True + + + Bypassing the LAN address + + + 0 + + + 3, 17 + + + Bypass mainland address + + + 5, 45 + + + 9 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage6 + + + 3, 3, 3, 3 + + + 0 + + + tabPage4 + + + chkEnableStatistics + + + OptionSettingForm + + + 120, 16 + + + 2 + + groupBox2 + + label14 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + Record local logs + + + tabPage9 + + + 3, 3, 3, 3 + + + *Set user pac rules, separated by commas (,) + + + 5 + + + tabPage5 + + + 3, 84 + + + tabPage7 + + + 229, 23 + + + IPOnDemand + + + labRoutingTips + + + 0 + + + Fill + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl1 + + + 33, 29 + + + 11 + + + 21 + + + 15, 192 + + + groupBox1 + + + Custom GFWList address (please fill in the blank without customization) + + + 75, 23 + + + tabControl1 + + + tabPage10 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17 + + + 3, 3, 3, 3 + + + tabPage7 + + + lbFreshrate + + + 8 + + + 7 + + + 15 + + + 11 + + + 654, 579 + + + 4, 4, 4, 4 + + + 15 + + + 4, 22 + + + 662, 605 + + + 201, 50 + + + True + + + 2 + + + panel2 + + + Not Enabled Http Proxy + + + 31 + + + 0 + + + 0 + + + *Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP + + + 3 + + + True + + + 4.Pre-defined rules + + + txtHotkeyPACProxyMode + + + 2 + + + none + + + cmbdomainStrategy + + + 7 + + + 634, 460 + + + label10 + + + False + + + 94, 21 + + + 13 + + + 3.Block Domain or IP + + + 78, 21 + + + 3 + + + cmbroutingMode + + + 236, 104 + + + 16 + + + True + + + label11 + + + 12 + + + True + + + 1 + + + tabPage10 + + + $this + + + 4 + + + groupBox1 + + + 111, 62 + + + 10 + + + 15, 160 + + + 97, 20 + + + Quickly add a user PAC rule + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + 11 + + + 23 + + + cmbloglevel + + + 3, 3 + label16 - - btnOK + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Set default custom routing rules + + groupBox1 - + + True + + + 3 + + + 1 + + + groupBox1 + + + 628, 454 + + + 9 + + + True + + + 14 + + + 58, 20 + + + Start using PAC proxy mode + + + lblHotkeyStopProxy + + + v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + 161, 84 + + + 468, 27 + + + groupBox1 + + + cmbprotocol2 + + + 7 + + + Bypassing LAN and mainland address + + + False + + + btnSetDefRountingRule + + + 7 + + + 167, 12 + + + 0, 615 + + + txtUserdirect + + + True + + + Bottom + + + 4, 22 + + + tti + + + 576, 16 + + + 0 + + + 4, 22 + + + 0 + + + Top + + + groupBox1 + + + 4 + + tabPage6 - - txturlGFWList + + 3, 3, 3, 3 + + + 3 + + + Only open PAC and do nothing + + + 9 + + + 94, 21 + + + tabPage6 + + + Settings + + + 16 + + + 89, 12 + + + 3, 3, 3, 3 + + + 628, 454 chkmuxEnabled + + btnOK + + + 0 + + + groupBox2 + + + label2 + + + 5 + + + 0 + + + tabPage6 + + + 1 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + label13 + + + 97, 20 + + + True + + + 111, 100 + + + 6 + + + 4 + + + 3, 3 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 7 + + + 5, 14 + + + protocol + + + True + + + 642, 486 + + + tabControl2 + + + Custom DNS (multiple, separated by commas (,)) + + + Only open Http proxy and do nothing + + + txturlGFWList + + + txtHotkeyAddUserPAC + + + 6 + + + chklogEnabled + + + 345, 62 + + + Stop the proxy service + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 59, 12 + + + tabPage10 + + + 2 + + + 2 + + + Fill + + + 4 + + + 33, 253 + + + 0 + + + 12, 124 + + + 111, 24 + + + 3 + + + 12, 89 + + + groupBox1 + + + 3, 3, 3, 3 + + + txtKcpmtu + + + 6 + + + Fill + + + Start using global proxy mode + + + 0 + + + Enable UDP + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 124, 94 + + + 4 + + + 102, 16 + + + AsIs + + + True + + + IPIfNonMatch + + + True + + + Fill + + + groupBox1 + + + 6 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 662, 675 + + + groupBox1 + + + txtKcpwriteBufferSize + + + 18, 28 + + + 101, 12 + + + 662, 10 + + + 236, 28 + + + tabPage7 + + + groupBox1 + + + NoControl + + + tabPage10 + + + Only open PAC, do not automatically configure PAC + + + 75, 23 + + + 179, 12 + + + 3, 3 + + + 30 + + + True + + + 648, 37 + + + tabPage7 + + + 1 + + + 124, 60 + + + tabPage10 + + + chksniffingEnabled + + + 0 + + + 4, 22 + + + Vertical + + + groupBox1 + + + 198, 16 + + + btnClose + + + 15, 110 + + + 165, 20 + + + 0, 10 + + + 1 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 27 + + + NoControl + + + 42, 98 + + + chkRegHotkeyAtStartup + + + 12 + + + 257, 60 + + + tabPage4 + + + 115, 10 + + + 1 + + + 53, 12 + + + Fill + + + 20 + + + 207, 21 + + + True + + + 5 + + + 634, 460 + + + True + + + 207, 21 + + + NoControl + + + 9 + + + 598, 16 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 13 + + + tabPage7 + + + 0, 0, 0, 0 + + + 84, 16 + + + 3, 3, 3, 3 + + + NoControl + + + 12, 54 + + + 65, 12 + + + 654, 579 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 137, 12 + + + True + + + 654, 579 + + + 30, 87 + + + tabControl1 + + + lblHotkeyAddUserPAC + + + 1 + + + tabPage1 + + + 201, 15 + + + 10 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage10 + + + groupBox1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + allowInsecure + + + 13 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 10 + + + 1 + + + tabPage7 + + + True + + + 654, 579 + + + protocol + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 201, 120 + + + 20 + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 369, 27 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + chkudpEnabled + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 78, 21 + + + tabPage5 + + + 541, 100 + + + panel2 + + + tabControl1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + 10 + + + tabControl1 + + + Core: basic settings + + + 6 + + + 0 + + + 12 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + User PAC settings + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + txtUserblock + + + tabPage2 + + + Global + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + tabPage8 + + + 94, 21 + + + tabPage10 + + + 0 + + + chkAutoRun + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 2.Direct Domain or IP + + + label6 + + + False + + + chkdefAllowInsecure + + + label3 + + + tabPage9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 1 + + + Set default custom routing rules + + + tabPage3 + + + txtKcptti + + + 23, 12 + + + 11 + + + 298, 24 + + + 4, 22 + + + 13 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 28 + + + 30 + + + 7 + + + 1 + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + writeBufferSize + + + Top + + + 662, 60 + + + txtKcpdownlinkCapacity + + + label4 + + + Keep older when deduplication + + + label8 + + + Vertical + + + 257, 158 + + + 10 + + + NoControl + + + &Cancel + + + tabPage6 + + + 3, 3, 3, 3 + + + groupBox1 + + + chkAllowLANConn + + + 32 + + + 32 + + + False + + + 14, 154 + + + tabPage6 + + + tabControl2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage8 + + + 89, 12 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + http + + + 555, 100 + + + True + + + 3, 40 + + + 89, 12 + + + 12 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Automatically start at system startup + + + congestion + + + 1 + + + Hotkey settings + + + 431, 12 + + + groupBox1 + + + False + + + 97, 20 + + + 1 + + + 0 + + + 21, 17 + + + tabPage6 + + + tabPage10 + + + 4, 22 + + + 19 + + + tabControl2 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage10 + + + 20 + + + groupBox1 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 1 + + + 345, 24 + + + Top + + + txtHotkeyGlobalProxyMode + + + False + + + NoControl + + + 4, 22 + + + 120, 16 + + + txtHotkeyStopProxy + + + True + + + 8 + + + warning + + + 16 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + 18, 66 + + + Allow connections from the LAN + + + 3, 3 + + + NoControl + + + 14 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 246, 16 + + + tabPage1 + + + chkAllowIn2 + + + 369, 62 + + + 94, 21 + + + Fill + + + panel3 + + + txtuserPacRule + + + True + + + True + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6 + + + True + + + 8 + + + Turn on Mux Multiplexing + + + 4, 22 + + + 464, 20 + + + groupBox1 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + 94, 21 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Turn on Sniffing + + + socks + + + True + + + 5 + + + 33 + + + 29 + + + http + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Fill + + + 13 + + + txtUseragent + + + True + + + label1 + + + 5 + + + Domain strategy + + + groupBox1 + + + label5 + + + $this + 654, 579 + + 3 + + + 3, 3, 3, 3 + + + label9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 345, 100 + + + groupBox1 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 648, 536 + + + 9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 267, 16 + + + txtKcpuplinkCapacity + + + 3 + + + 322, 10 + + + NoControl + + + 206, 29 + + + 0 + + + 634, 460 + + + 648, 573 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 201, 85 + + + True + + + tabControl1 + + + 5, 11 + + + 14 + + + tabControl2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 2 + + + &OK + + + groupBox1 + + + 634, 460 + + + chkudpEnabled2 + + + 281, 12 + + + 2 + + + 20, 143 + + + tabControl2 + + + 255, 20 + + + True + + + 1.Proxy Domain or IP + + + 20 + + + 126, 16 + + + 14 + + + 23, 12 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage6 + + + label7 + + + True + + + 120, 16 + + + chksniffingEnabled2 + + + True + + + txtremoteDNS + + + Http proxy + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 204, 16 + + + 32, 205 + + + 6, 12 + + + 3, 3 + + + 642, 67 + + + 12 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + v2rayN settings + + + Turn on Sniffing + + + 19 + + + Core: Routing settings + + + 10 + + + False + + + 15, 63 + + + 15, 38 + + + 12 + + + 3, 3 + + + Enable Statistics (Realtime netspeed and traffic records. Require restart the v2rayN client) + + + $this + + + 5 + + + panel2 + + + txtlocalPort2 + + + 8 + + + debug + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + info + + + panel4 + + + Vertical + + + Core: KCP settings + + + tabControl1 + + + 207, 21 + + + 95, 12 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 4 + + + 468, 60 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 53, 12 + + + 29 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + chkKcpcongestion + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 1 + + + 17 + + + 0 + + + panel3 + + + 33 + + + 7 + + + 3 + + + 2 + + + tabPage3 + + + 654, 579 + tabPage6 - - tabControl1 + + 21 - + + 648, 573 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 628, 454 + + + panel3 + + + 29 + + + 30, 176 + + + 11 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Register the hotkeys at startup + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + cmbprotocol + + + 94, 21 + + + 174, 16 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 34 + + + True + + 0 - - 15, 110 + + 84, 16 - - 5, 11 + + txtKcpreadBufferSize - - 0 + + lblHotkeyGlobalProxyMode - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tabPage6 + + + lblHotkeyPACProxyMode + + + tabPage7 + + + True + + + cmblistenerType + + + 9 0, 0 - - Enable UDP + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True - - 3, 3, 3, 3 + + uplinkCapacity - - groupBox1 + + 207, 21 + + + 18 + + + 8 + + + Vertical 19 - - 2.Direct Domain or IP + + 598, 16 - - 267, 16 + + True - - Global + + Only open Http proxy, do not automatically configure proxy server (direct mode) - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 9 - - - 0 - - - 322, 10 - - - 15, 192 - - - 0 - - - 94, 21 - - - 3 - - - Keep older when deduplication - - - 3, 3, 3, 3 - - - 236, 28 - - - Bottom - - - 3 + + 2 System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 - - - groupBox1 - - - 125, 12 - - - 3, 3, 3, 3 - - - 11 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 124, 60 - - - cbFreshrate - - - 246, 16 - - + tabPage6 - - label6 - - - 111, 24 - - - panel2 - - - 21 - - - label9 - - - 0, 10 - - - panel1 - - - 2 - - - label14 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx index 81c0d92c..7681a2c0 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx @@ -369,6 +369,57 @@ *设置用户PAC规则,用逗号(,)隔开 + + 快捷键设置 + + + True + + + 16, 160 + + + 144, 16 + + + 启动时注册所有快捷键 + + + 146, 121 + + + 95, 12 + + + 添加用户PAC记录 + + + 146, 85 + + + 119, 12 + + + 开启使用PAC代理模式 + + + 146, 50 + + + 125, 12 + + + 开启使用全局代理模式 + + + 146, 15 + + + 77, 12 + + + 关闭代理服务 + 确定(&O) diff --git a/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.Designer.cs b/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.Designer.cs new file mode 100644 index 00000000..bcb7f89f --- /dev/null +++ b/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.Designer.cs @@ -0,0 +1,89 @@ +namespace v2rayN.Forms +{ + partial class QuicklyAddUserPACForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(QuicklyAddUserPACForm)); + this.label6 = new System.Windows.Forms.Label(); + this.txtUserPACRule = new System.Windows.Forms.TextBox(); + this.btnClose = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label6 + // + resources.ApplyResources(this.label6, "label6"); + this.label6.Name = "label6"; + // + // txtUserPACRule + // + resources.ApplyResources(this.txtUserPACRule, "txtUserPACRule"); + this.txtUserPACRule.Name = "txtUserPACRule"; + // + // btnClose + // + this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.btnClose, "btnClose"); + this.btnClose.Name = "btnClose"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // btnOK + // + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + resources.ApplyResources(this.btnOK, "btnOK"); + this.btnOK.Name = "btnOK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // QuicklyAddUserPACForm + // + this.AcceptButton = this.btnOK; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnClose; + this.Controls.Add(this.btnClose); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.txtUserPACRule); + this.Controls.Add(this.label6); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "QuicklyAddUserPACForm"; + this.VisibleChanged += new System.EventHandler(this.QuicklyAddUserPACForm_VisibleChanged); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txtUserPACRule; + private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Button btnOK; + } +} \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.cs b/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.cs new file mode 100644 index 00000000..31b08403 --- /dev/null +++ b/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using v2rayN.Base; + +namespace v2rayN.Forms +{ + public partial class QuicklyAddUserPACForm : BaseForm + { + public QuicklyAddUserPACForm() + { + InitializeComponent(); + } + + + private void btnOK_Click(object sender, EventArgs e) + { + string userPacRule=this.txtUserPACRule.Text.TrimEx().Replace("\"", ""); + this.txtUserPACRule.Text = ""; + if (!string.IsNullOrEmpty(userPacRule)) + { + config.userPacRule.Insert(0, userPacRule); + this.DialogResult = DialogResult.OK; + } + else + { + this.DialogResult = DialogResult.Cancel; + } + } + + private void btnClose_Click(object sender, EventArgs e) + { + this.txtUserPACRule.Text = ""; + this.DialogResult = DialogResult.Cancel; + } + + private void QuicklyAddUserPACForm_VisibleChanged(object sender, EventArgs e) + { + //在主屏幕的左下角显示窗口 + if (this.Visible == true) + { + int heightLocation = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height - this.Size.Height - 10; + this.SetDesktopLocation(12, heightLocation); + this.Activate(); + } + this.txtUserPACRule.Focus(); + } + + } +} diff --git a/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.resx b/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.resx new file mode 100644 index 00000000..71bce647 --- /dev/null +++ b/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.resx @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + True + + + + NoControl + + + + 10, 12 + + + 83, 12 + + + 11 + + + User PAC rule + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 12, 37 + + + 341, 21 + + + 12 + + + txtUserPACRule + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + NoControl + + + 278, 72 + + + 75, 23 + + + 14 + + + &Cancel + + + btnClose + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + NoControl + + + 195, 72 + + + 75, 23 + + + 13 + + + &OK + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + + 6, 12 + + + 365, 106 + + + Manual + + + Quickly add user PAC rule + + + QuicklyAddUserPACForm + + + v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.zh-Hans.resx new file mode 100644 index 00000000..add69ba9 --- /dev/null +++ b/v2rayN/v2rayN/Forms/QuicklyAddUserPACForm.zh-Hans.resx @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 95, 12 + + + + 0 + + + 用户PAC规则地址 + + + 11 + + + 取消 + + + 确定 + + + 快速添加用户PAC规则 + + \ No newline at end of file diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index fefad821..d281e88f 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -156,6 +156,10 @@ namespace v2rayN.Handler { config.userPacRule = new List(); } + if (config.hotkeyConfig == null) + { + config.hotkeyConfig = new HotkeyConfig(); + } if (config == null || config.index < 0 diff --git a/v2rayN/v2rayN/Handler/Hotkey/HotkeyCallbacks.cs b/v2rayN/v2rayN/Handler/Hotkey/HotkeyCallbacks.cs new file mode 100644 index 00000000..29eaa10a --- /dev/null +++ b/v2rayN/v2rayN/Handler/Hotkey/HotkeyCallbacks.cs @@ -0,0 +1,82 @@ +using System; +using System.Reflection; + + +namespace v2rayN.Handler.Hotkey +{ + public class HotkeyCallbacks + { + + public static void InitInstance(V2rayHandler v2rayHandler) + { + if (Instance != null) + { + return; + } + + Instance = new HotkeyCallbacks(v2rayHandler); + } + + /// + /// Create hotkey callback handler delegate based on callback name + /// + /// + /// + public static Delegate GetCallback(string methodname) + { + if (string.IsNullOrEmpty(methodname)) throw new ArgumentException(nameof(methodname)); + MethodInfo dynMethod = typeof(HotkeyCallbacks).GetMethod(methodname, + BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.IgnoreCase); + return dynMethod == null ? null : Delegate.CreateDelegate(typeof(Hotkeys.HotKeyCallBackHandler), Instance, dynMethod); + } + + #region Singleton + + private static HotkeyCallbacks Instance { get; set; } + + private readonly V2rayHandler _v2rayHandler; + + private HotkeyCallbacks(V2rayHandler v2rayHandler) + { + _v2rayHandler = v2rayHandler; + } + + #endregion + + #region Callbacks + + /// + /// 停止系统代理服务 + /// + private void StopProxyCallback() + { + _v2rayHandler.StopProxy(); + } + + /// + /// 开启使用全局代理服务模式 + /// + private void GlobalProxyModeCallback() + { + _v2rayHandler.StartUseGlobalProxyMode(); + } + + /// + /// 开启使用PAC代理服务模式 + /// + private void PACProxyModeCallback() + { + _v2rayHandler.StartUsePACProxyMode(); + } + + /// + /// 快速添加用户PAC规则 + /// + private void AddUserPACCallback() + { + _v2rayHandler.ShowAddUserPACForm(); + } + + #endregion + } +} \ No newline at end of file diff --git a/v2rayN/v2rayN/Handler/Hotkey/HotkeyReg.cs b/v2rayN/v2rayN/Handler/Hotkey/HotkeyReg.cs new file mode 100644 index 00000000..182e10d9 --- /dev/null +++ b/v2rayN/v2rayN/Handler/Hotkey/HotkeyReg.cs @@ -0,0 +1,82 @@ +using System; +using System.Windows.Forms; +using v2rayN.Mode; + +namespace v2rayN.Handler.Hotkey +{ + public static class HotkeyReg + { + public static void RegAllHotkeys(HotkeyConfig hotkeyConfig) + { + if (hotkeyConfig == null || !hotkeyConfig.regHotkeyAtStartup) + return; + + // if any of the hotkey reg fail, undo everything + if (RegHotkeyFromString(hotkeyConfig.stopProxy, "StopProxyCallback") + && RegHotkeyFromString(hotkeyConfig.globalProxyMode, "GlobalProxyModeCallback") + && RegHotkeyFromString(hotkeyConfig.pacProxyMode, "PACProxyModeCallback") + && RegHotkeyFromString(hotkeyConfig.addUserPAC, "AddUserPACCallback") + ) + { + // success + } + else + { + RegHotkeyFromString("", "StopProxyCallback"); + RegHotkeyFromString("", "GlobalProxyModeCallback"); + RegHotkeyFromString("", "PACProxyModeCallback"); + RegHotkeyFromString("", "AddUserPACCallback"); + UI.ShowWarning(UIRes.I18N("HotkeyRegFailed")); + } + } + + public static bool RegHotkeyFromString(string hotkeyStr, string callbackName, Action onComplete = null) + { + var _callback = HotkeyCallbacks.GetCallback(callbackName); + if (_callback == null) + { + throw new Exception($"{callbackName} not found"); + } + + var callback = _callback as Hotkeys.HotKeyCallBackHandler; + + if (string.IsNullOrEmpty(hotkeyStr)) + { + Hotkeys.UnregExistingHotkey(callback); + onComplete?.Invoke(RegResult.UnregSuccess); + return true; + } + else + { + var hotkey = Hotkeys.Str2HotKey(hotkeyStr); + if (hotkey == null) + { + onComplete?.Invoke(RegResult.ParseError); + return false; + } + else + { + bool regResult = (Hotkeys.RegHotkey(hotkey, callback)); + if (regResult) + { + onComplete?.Invoke(RegResult.RegSuccess); + } + else + { + onComplete?.Invoke(RegResult.RegFailure); + } + return regResult; + } + } + } + + public enum RegResult + { + RegSuccess, + RegFailure, + ParseError, + UnregSuccess, + //UnregFailure + } + } +} diff --git a/v2rayN/v2rayN/Handler/Hotkey/Hotkeys.cs b/v2rayN/v2rayN/Handler/Hotkey/Hotkeys.cs new file mode 100644 index 00000000..878f4159 --- /dev/null +++ b/v2rayN/v2rayN/Handler/Hotkey/Hotkeys.cs @@ -0,0 +1,175 @@ +using GlobalHotKey; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Windows.Input; +using v2rayN.Mode; + +namespace v2rayN.Handler.Hotkey +{ + public static class Hotkeys + { + private static HotKeyManager _hotKeyManager; + + public delegate void HotKeyCallBackHandler(); + // map key and corresponding handler function + private static Dictionary _keymap = new Dictionary(); + + public static void Init(V2rayHandler v2rayHandler) + { + _hotKeyManager = new HotKeyManager(); + _hotKeyManager.KeyPressed += HotKeyManagerPressed; + + HotkeyCallbacks.InitInstance(v2rayHandler); + } + + public static void Destroy() + { + _hotKeyManager.KeyPressed -= HotKeyManagerPressed; + _hotKeyManager.Dispose(); + } + + private static void HotKeyManagerPressed(object sender, KeyPressedEventArgs e) + { + var hotkey = e.HotKey; + HotKeyCallBackHandler callback; + if (_keymap.TryGetValue(hotkey, out callback)) + callback(); + } + + public static bool RegHotkey(HotKey hotkey, HotKeyCallBackHandler callback) + { + UnregExistingHotkey(callback); + return Register(hotkey, callback); + } + + public static bool UnregExistingHotkey(Hotkeys.HotKeyCallBackHandler cb) + { + HotKey existingHotKey; + if (IsCallbackExists(cb, out existingHotKey)) + { + // unregister existing one + Unregister(existingHotKey); + return true; + } + else + { + return false; + } + } + + public static bool IsHotkeyExists(HotKey hotKey) + { + if (hotKey == null) throw new ArgumentNullException(nameof(hotKey)); + return _keymap.Any(v => v.Key.Equals(hotKey)); + } + + public static bool IsCallbackExists(HotKeyCallBackHandler cb, out HotKey hotkey) + { + if (cb == null) throw new ArgumentNullException(nameof(cb)); + if (_keymap.Any(v => v.Value == cb)) + { + hotkey = _keymap.First(v => v.Value == cb).Key; + return true; + } + else + { + hotkey = null; + return false; + } + } + + #region Converters + + public static string HotKey2Str(HotKey key) + { + if (key == null) throw new ArgumentNullException(nameof(key)); + return HotKey2Str(key.Key, key.Modifiers); + } + + public static string HotKey2Str(Key key, ModifierKeys modifier) + { + if (!Enum.IsDefined(typeof(Key), key)) + throw new InvalidEnumArgumentException(nameof(key), (int)key, typeof(Key)); + try + { + ModifierKeysConverter mkc = new ModifierKeysConverter(); + var keyStr = Enum.GetName(typeof(Key), key); + var modifierStr = mkc.ConvertToInvariantString(modifier); + + return $"{modifierStr}+{keyStr}"; + } + catch (NotSupportedException) + { + // converter exception + return null; + } + } + + public static HotKey Str2HotKey(string s) + { + try + { + if (string.IsNullOrEmpty(s)) return null; + int offset = s.LastIndexOf("+", StringComparison.OrdinalIgnoreCase); + if (offset <= 0) return null; + string modifierStr = s.Substring(0, offset).Trim(); + string keyStr = s.Substring(offset + 1).Trim(); + + KeyConverter kc = new KeyConverter(); + ModifierKeysConverter mkc = new ModifierKeysConverter(); + Key key = (Key)kc.ConvertFrom(keyStr.ToUpper()); + ModifierKeys modifier = (ModifierKeys)mkc.ConvertFrom(modifierStr.ToUpper()); + + return new HotKey(key, modifier); + } + catch (NotSupportedException) + { + // converter exception + return null; + } + catch (NullReferenceException) + { + return null; + } + } + + #endregion + + private static bool Register(HotKey key, HotKeyCallBackHandler callBack) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + if (callBack == null) + throw new ArgumentNullException(nameof(callBack)); + try + { + _hotKeyManager.Register(key); + _keymap[key] = callBack; + return true; + } + catch (ArgumentException) + { + // already called this method with the specific hotkey + // return success silently + return true; + } + catch (Win32Exception) + { + // this hotkey already registered by other programs + // notify user to change key + return false; + } + } + + private static void Unregister(HotKey key) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + _hotKeyManager.Unregister(key); + if (_keymap.ContainsKey(key)) + _keymap.Remove(key); + } + } +} \ No newline at end of file diff --git a/v2rayN/v2rayN/Handler/V2rayHandler.cs b/v2rayN/v2rayN/Handler/V2rayHandler.cs index cc6c404e..a8fb1cf7 100644 --- a/v2rayN/v2rayN/Handler/V2rayHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayHandler.cs @@ -18,11 +18,17 @@ namespace v2rayN.Handler /// /// v2ray进程处理类 /// - class V2rayHandler + public class V2rayHandler { private static string v2rayConfigRes = Global.v2rayConfigFileName; private List lstV2ray; public event ProcessDelegate ProcessEvent; + + public event EventHandler StopProxyEvent; + public event EventHandler StartGlobalProxyModeEvent; + public event EventHandler StartPACProxyModeEvent; + public event EventHandler ShowAddUserPACEvent; + //private int processId = 0; private Process _process; @@ -300,6 +306,23 @@ namespace v2rayN.Handler { ProcessEvent?.Invoke(updateToTrayTooltip, msg); } + + public void StopProxy() + { + StopProxyEvent?.Invoke(null, null); + } + public void StartUseGlobalProxyMode() + { + StartGlobalProxyModeEvent?.Invoke(null, null); + } + public void StartUsePACProxyMode() + { + StartPACProxyModeEvent?.Invoke(null, null); + } + public void ShowAddUserPACForm() + { + ShowAddUserPACEvent?.Invoke(null, null); + } private void KillProcess(Process p) { diff --git a/v2rayN/v2rayN/Mode/Config.cs b/v2rayN/v2rayN/Mode/Config.cs index 3c8bf76b..296e2a18 100644 --- a/v2rayN/v2rayN/Mode/Config.cs +++ b/v2rayN/v2rayN/Mode/Config.cs @@ -207,6 +207,14 @@ namespace v2rayN.Mode get; set; } + /// + /// 快捷键设置 + /// + public HotkeyConfig hotkeyConfig + { + get; set; + } + #region 函数 public string address() @@ -716,4 +724,38 @@ namespace v2rayN.Mode get; set; } } + + [Serializable] + public class HotkeyConfig + { + /// + /// 停止代理服务的快捷键 + /// + public string stopProxy { get; set; } + /// + /// 开启使用全局代理服务的快捷键 + /// + public string globalProxyMode { get; set; } + /// + /// 开启使用PAC代理模式的快捷键 + /// + public string pacProxyMode { get; set; } + /// + /// 打开添加一条用户PAC规则窗口的快捷键 + /// + public string addUserPAC { get; set; } + /// + /// 是否在程序启动时注册所有的快捷键 + /// + public bool regHotkeyAtStartup { get; set; } + + public HotkeyConfig() + { + stopProxy = ""; + globalProxyMode = ""; + pacProxyMode = ""; + addUserPAC = ""; + regHotkeyAtStartup = false; + } + } } diff --git a/v2rayN/v2rayN/Properties/AssemblyInfo.cs b/v2rayN/v2rayN/Properties/AssemblyInfo.cs index 97197c1b..de099cbc 100644 --- a/v2rayN/v2rayN/Properties/AssemblyInfo.cs +++ b/v2rayN/v2rayN/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ using System.Runtime.InteropServices; // 方法是按如下所示使用“*”: //[assembly: AssemblyVersion("1.0.*")] //[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("3.19")] +[assembly: AssemblyFileVersion("3.20")] diff --git a/v2rayN/v2rayN/Resx/ResUI.Designer.cs b/v2rayN/v2rayN/Resx/ResUI.Designer.cs index b5b956d6..d04d10da 100644 --- a/v2rayN/v2rayN/Resx/ResUI.Designer.cs +++ b/v2rayN/v2rayN/Resx/ResUI.Designer.cs @@ -240,6 +240,24 @@ namespace v2rayN.Resx { } } + /// + /// 查找类似 Cannot parse hotkey: {0} 的本地化字符串。 + /// + internal static string HotkeyParseFailed { + get { + return ResourceManager.GetString("HotkeyParseFailed", resourceCulture); + } + } + + /// + /// 查找类似 Register hotkey failed 的本地化字符串。 + /// + internal static string HotkeyRegFailed { + get { + return ResourceManager.GetString("HotkeyRegFailed", resourceCulture); + } + } + /// /// 查找类似 is not the correct client configuration file, please check 的本地化字符串。 /// diff --git a/v2rayN/v2rayN/Resx/ResUI.resx b/v2rayN/v2rayN/Resx/ResUI.resx index 50d37abe..a1cff61b 100644 --- a/v2rayN/v2rayN/Resx/ResUI.resx +++ b/v2rayN/v2rayN/Resx/ResUI.resx @@ -177,6 +177,12 @@ Please fill in the user ID + + Cannot parse hotkey: {0} + + + Register hotkey failed + is not the correct client configuration file, please check diff --git a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx index 4b312497..9dfca4dc 100644 --- a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx @@ -177,6 +177,12 @@ 请填写用户ID + + 无法识别的快捷键: {0} + + + 注册快捷键失败,请检查冲突或修改快捷键重试 + 不是正确的客户端配置文件,请检查 diff --git a/v2rayN/v2rayN/v2rayN.csproj b/v2rayN/v2rayN/v2rayN.csproj index 64ece7d3..72e76869 100644 --- a/v2rayN/v2rayN/v2rayN.csproj +++ b/v2rayN/v2rayN/v2rayN.csproj @@ -112,6 +112,12 @@ MainForm.cs + + Form + + + QuicklyAddUserPACForm.cs + Form @@ -142,6 +148,8 @@ SubSettingControl.cs + + @@ -208,6 +216,7 @@ + @@ -244,11 +253,18 @@ OptionSettingForm.cs + Designer QRCodeControl.cs Designer + + QuicklyAddUserPACForm.cs + + + QuicklyAddUserPACForm.cs + SubSettingControl.cs Designer @@ -382,6 +398,9 @@ + + 1.1.0 + 3.11.4