diff --git a/v2rayN/v2rayN.sln b/v2rayN/v2rayN.sln index 0b906d27..64cf71f4 100644 --- a/v2rayN/v2rayN.sln +++ b/v2rayN/v2rayN.sln @@ -35,6 +35,7 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution + RESX_SortFileContentOnSave = True SolutionGuid = {56B88873-C9CC-4069-A1E5-DABD6C6E865E} EndGlobalSection EndGlobal diff --git a/v2rayN/v2rayN/Base/HttpWebServer.cs b/v2rayN/v2rayN/Base/HttpWebServer.cs index bbf26c53..9fa72495 100644 --- a/v2rayN/v2rayN/Base/HttpWebServer.cs +++ b/v2rayN/v2rayN/Base/HttpWebServer.cs @@ -57,7 +57,7 @@ namespace v2rayN.Base { ThreadPool.QueueUserWorkItem((c) => { - var ctx = c as HttpListenerContext; + HttpListenerContext ctx = c as HttpListenerContext; try { string address = ctx.Request.LocalEndPoint.Address.ToString(); diff --git a/v2rayN/v2rayN/Base/HttpWebServerB.cs b/v2rayN/v2rayN/Base/HttpWebServerB.cs index a440efec..403ffedb 100644 --- a/v2rayN/v2rayN/Base/HttpWebServerB.cs +++ b/v2rayN/v2rayN/Base/HttpWebServerB.cs @@ -17,8 +17,10 @@ namespace v2rayN.Base this.port = port; this._responderMethod = method; - Thread thread = new Thread(StartListen); - thread.IsBackground = true; + Thread thread = new Thread(StartListen) + { + IsBackground = true + }; thread.Start(); } @@ -46,8 +48,10 @@ namespace v2rayN.Base } TcpClient socket = listener.AcceptTcpClient(); - Thread thread = new Thread(new ParameterizedThreadStart(ProcessThread)); - thread.IsBackground = true; + Thread thread = new Thread(new ParameterizedThreadStart(ProcessThread)) + { + IsBackground = true + }; thread.Start(socket); Thread.Sleep(1); } @@ -56,19 +60,19 @@ namespace v2rayN.Base { try { - var socket = obj as TcpClient; + TcpClient socket = obj as TcpClient; - var inputStream = new BufferedStream(socket.GetStream()); - var outputStream = new StreamWriter(new BufferedStream(socket.GetStream())); + BufferedStream inputStream = new BufferedStream(socket.GetStream()); + StreamWriter outputStream = new StreamWriter(new BufferedStream(socket.GetStream())); if (inputStream.CanRead) { - var data = ReadStream(inputStream); + string data = ReadStream(inputStream); if (data.Contains("/pac/")) { if (_responderMethod != null) { - var address = ((IPEndPoint)socket.Client.LocalEndPoint).Address.ToString(); + string address = ((IPEndPoint)socket.Client.LocalEndPoint).Address.ToString(); Utils.SaveLog("WebserverB Request " + address); string pac = _responderMethod(address); @@ -118,7 +122,7 @@ namespace v2rayN.Base private void WriteStream(StreamWriter outputStream, string pac) { - var content_type = "application/x-ns-proxy-autoconfig"; + string content_type = "application/x-ns-proxy-autoconfig"; outputStream.WriteLine("HTTP/1.1 200 OK"); outputStream.WriteLine(String.Format("Content-Type:{0}", content_type)); outputStream.WriteLine("Connection: close"); diff --git a/v2rayN/v2rayN/Base/ListViewFlickerFree.cs b/v2rayN/v2rayN/Base/ListViewFlickerFree.cs index 7fc58205..6785959b 100644 --- a/v2rayN/v2rayN/Base/ListViewFlickerFree.cs +++ b/v2rayN/v2rayN/Base/ListViewFlickerFree.cs @@ -22,7 +22,7 @@ namespace v2rayN.Base int MaxWidth = 0; Graphics graphics = this.CreateGraphics(); Font font = this.Font; - ListView.ListViewItemCollection items = this.Items; + ListViewItemCollection items = this.Items; string str; int width; diff --git a/v2rayN/v2rayN/Base/StringEx.cs b/v2rayN/v2rayN/Base/StringEx.cs index e7f87a44..40544106 100644 --- a/v2rayN/v2rayN/Base/StringEx.cs +++ b/v2rayN/v2rayN/Base/StringEx.cs @@ -24,7 +24,7 @@ namespace v2rayN.Base public static bool IsWhiteSpace(this string value) { - foreach (var c in value) + foreach (char c in value) { if (char.IsWhiteSpace(c)) continue; diff --git a/v2rayN/v2rayN/Forms/AddServer2Form.resx b/v2rayN/v2rayN/Forms/AddServer2Form.resx index c98d40e0..969bc410 100644 --- a/v2rayN/v2rayN/Forms/AddServer2Form.resx +++ b/v2rayN/v2rayN/Forms/AddServer2Form.resx @@ -117,274 +117,148 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - txtAddress - - - Address - - - 0 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Bottom - - - True - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnOK - - - txtRemarks - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AddServer2Form - - - label1 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - panel2 - - - 12, 27 - - - Fill - - - True - - - 313, 21 - - - groupBox1 - 6, 12 - - True - - - Alias (remarks) - - - 127, 23 - - - 6 - - - 7 - - - groupBox1 - - - 113, 12 - - - 4 - - - Server - - - 23 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - 611, 60 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Edit custom configuration server - - - 432, 104 - - - 611, 10 - - - groupBox1 - - - * Fill in manually - - - 11 - - - 10 - - - panel1 - - - 75, 23 - - - 2 - - - btnClose - - - 303, 17 - - - 0, 211 - - - 75, 23 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - Top - - - 0, 10 - - - 3 - - - 611, 201 - - - 2 - - - 4 - - - 3 - - - 127, 62 - - - groupBox1 - - - True - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 83, 12 - - - &Cancel - - - 12, 62 - - - &OK - - - 0 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 446, 26 - - - groupBox1 - - - label6 - - - $this - - - 1 - - - 0, 0 - - - panel2 - - - label13 - - - 83, 12 - - - 22 - - - 1 - - - panel2 - - - 5 - 611, 271 - - 0 + + True - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this + + Edit custom configuration server 396, 17 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 75, 23 - - 1 + + 4 - + + &Cancel + + + 303, 17 + + + 75, 23 + + + 5 + + + &OK + + + Fill + + + 0, 10 + + + 611, 201 + + + 3 + + + Server + + True - + + + 12, 62 + + + 83, 12 + + + 0 + + + Address + + + True + + + 446, 26 + + + 113, 12 + + + 22 + + + * Fill in manually + + + True + + + 12, 27 + + + 83, 12 + + + 10 + + + Alias (remarks) + + + Top + + + 0, 0 + + + 611, 10 + + + 6 + + + Bottom + + + 0, 211 + + + 611, 60 + + + 7 + + + 127, 62 + + + True + + + 432, 104 + + + 23 + + + 127, 23 + + + 313, 21 + + + 11 + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServer2Form.zh-Hans.resx b/v2rayN/v2rayN/Forms/AddServer2Form.zh-Hans.resx index a01d4dfa..482593c4 100644 --- a/v2rayN/v2rayN/Forms/AddServer2Form.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/AddServer2Form.zh-Hans.resx @@ -117,25 +117,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 编辑自定义配置服务器 + 取消(&C) + + 确定(&O) + + + 服务器 + + + 地址(address) + *手填,方便识别管理 别名(remarks) - - 地址(address) - - - 服务器 - - - 确定(&O) - - - 编辑自定义配置服务器 - \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServer3Form.cs b/v2rayN/v2rayN/Forms/AddServer3Form.cs index c39f2cfe..78192e45 100644 --- a/v2rayN/v2rayN/Forms/AddServer3Form.cs +++ b/v2rayN/v2rayN/Forms/AddServer3Form.cs @@ -121,8 +121,7 @@ namespace v2rayN.Forms { ClearServer(); - string msg; - VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out msg); + VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg); if (vmessItem == null) { UI.Show(msg); diff --git a/v2rayN/v2rayN/Forms/AddServer3Form.resx b/v2rayN/v2rayN/Forms/AddServer3Form.resx index f2f23bba..7aa4052a 100644 --- a/v2rayN/v2rayN/Forms/AddServer3Form.resx +++ b/v2rayN/v2rayN/Forms/AddServer3Form.resx @@ -118,57 +118,43 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 6, 12 + + + 547, 291 + + + True + + + Edit or add a [Shadowsocks] server + 396, 17 75, 23 - 4 &Cancel - - btnClose + + 303, 17 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 75, 23 - - panel2 + + 5 - - 0 - - - True - - - 337, 158 - - - 113, 12 - - - 22 - - - * Fill in manually - - - label13 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 + + &OK aes-256-cfb @@ -203,212 +189,20 @@ 6 - - cmbSecurity + + Fill - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0, 35 - - groupBox1 + + 547, 196 - - 1 - - - 127, 154 - - - 194, 21 - - - 11 - - - txtRemarks - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 2 - - - True - - - 12, 158 - - - 95, 12 - - - 10 - - - Alias (remarks) - - - label6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - + 3 - - True - - - 12, 124 - - - 65, 12 - - - 8 - - - Encryption - - - label5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 4 - - - 127, 85 - - - * - - - 278, 21 - - - 5 - - - txtId - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 5 - - - True - - - 12, 89 - - - 53, 12 - - - 4 - - - Password - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 6 - - - 127, 56 - - - 194, 21 - - - 3 - - - txtPort - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 7 - - - True - - - 12, 60 - - - 71, 12 - - - 2 - - - Server port - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 8 - - - 127, 27 - - - 359, 21 - - - 1 - - - txtAddress - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 9 + + Server True @@ -425,93 +219,104 @@ Server address - - label1 + + True - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 337, 158 - - groupBox1 + + 113, 12 - + + 22 + + + * Fill in manually + + + True + + + 12, 60 + + + 71, 12 + + + 2 + + + Server port + + + True + + + 12, 89 + + + 53, 12 + + + 4 + + + Password + + + True + + + 12, 124 + + + 65, 12 + + + 8 + + + Encryption + + + True + + + 12, 158 + + + 95, 12 + + 10 - - - Fill + + Alias (remarks) - - 0, 35 + + 162, 21 - - 547, 196 + + Import configuration file - - 3 + + 235, 22 - - Server + + Import URL from clipboard - - groupBox1 + + 0, 0 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 547, 25 - - $this + + 8 - - 0 - - - 303, 17 - - - 75, 23 - - - 5 - - - &OK - - - btnOK - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 1 - - - Bottom - - - 0, 231 - - - 547, 60 - - - 7 - - - panel2 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 + + 17, 17 Top @@ -525,82 +330,55 @@ 6 - - panel1 + + Bottom - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0, 231 - - $this + + 547, 60 - - 2 + + 7 - - 17, 17 - - - 235, 22 + + 127, 27 - - Import URL from clipboard + + 359, 21 - - 162, 21 + + 1 - - Import configuration file + + 127, 85 - - 0, 0 + + * - - 547, 25 + + 278, 21 - - 8 + + 5 - - menuServer + + 127, 56 - - System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 194, 21 - - $this - - + 3 - - True - - - 6, 12 + + 127, 154 - - 547, 291 + + 194, 21 - - Edit or add a [Shadowsocks] server - - - MenuItem1 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuItemImportClipboard - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AddServer3Form - - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + 11 \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServer3Form.zh-Hans.resx b/v2rayN/v2rayN/Forms/AddServer3Form.zh-Hans.resx index 2a5968ca..9cb34d6a 100644 --- a/v2rayN/v2rayN/Forms/AddServer3Form.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/AddServer3Form.zh-Hans.resx @@ -117,32 +117,38 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 编辑或添加[Shadowsocks]服务器 + 取消(&C) - - *手填,方便识别管理 - - - 别名(remarks) - - - 加密方式 - - - 密码 - - - 服务器端口 - - - 服务器地址 + + 确定(&O) 服务器 - - 确定(&O) + + 服务器地址 + + + *手填,方便识别管理 + + + 服务器端口 + + + 密码 + + + 加密方式 + + + 别名(remarks) + + + 导入配置文件 从剪贴板导入URL @@ -150,10 +156,4 @@ 扫描屏幕上的二维码 - - 导入配置文件 - - - 编辑或添加[Shadowsocks]服务器 - \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServer4Form.cs b/v2rayN/v2rayN/Forms/AddServer4Form.cs index d331bec2..6adad2c1 100644 --- a/v2rayN/v2rayN/Forms/AddServer4Form.cs +++ b/v2rayN/v2rayN/Forms/AddServer4Form.cs @@ -110,8 +110,7 @@ namespace v2rayN.Forms { ClearServer(); - string msg; - VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out msg); + VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg); if (vmessItem == null) { UI.Show(msg); diff --git a/v2rayN/v2rayN/Forms/AddServer4Form.resx b/v2rayN/v2rayN/Forms/AddServer4Form.resx index 566de4b3..8c8e6b8e 100644 --- a/v2rayN/v2rayN/Forms/AddServer4Form.resx +++ b/v2rayN/v2rayN/Forms/AddServer4Form.resx @@ -118,107 +118,104 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 6, 12 + + + 547, 291 + + + True + + + Edit or add a [Socks] server + 396, 17 75, 23 - 4 &Cancel - - btnClose + + 303, 17 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 75, 23 - - panel2 + + 5 - - 0 + + &OK - - 127, 84 + + Fill - - 278, 21 + + 0, 35 - - 26 + + 547, 196 - - txtSecurity + + 3 - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Server - - groupBox1 - - - 0 - - + True - - - NoControl + + 12, 31 - - 12, 88 - - + 89, 12 - - 25 + + 0 - - User(Optional) + + Server address - - label4 + + True - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 337, 158 - - groupBox1 + + 113, 12 - - 1 + + 22 - - 127, 117 + + * Fill in manually - - * + + True - - 278, 21 + + 12, 60 - - 24 + + 71, 12 - - txtId - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - + 2 + + Server port + True @@ -237,65 +234,23 @@ Password(Optional) - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 3 - - + True - - 337, 158 + + NoControl - - 113, 12 + + 12, 88 - - 22 + + 89, 12 - - * Fill in manually + + 25 - - label13 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 4 - - - 127, 154 - - - 194, 21 - - - 11 - - - txtRemarks - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 5 + + User(Optional) True @@ -312,188 +267,29 @@ Alias (remarks) - - label6 + + 162, 21 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Import configuration file - - groupBox1 + + 235, 22 - - 6 + + Import URL from clipboard - - 127, 56 + + 0, 0 - - 194, 21 + + 547, 25 - - 3 - - - txtPort - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 7 - - - True - - - 12, 60 - - - 71, 12 - - - 2 - - - Server port - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - + 8 - - 127, 27 - - - 359, 21 - - - 1 - - - txtAddress - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 9 - - - True - - - 12, 31 - - - 89, 12 - - - 0 - - - Server address - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 10 - - - Fill - - - 0, 35 - - - 547, 196 - - - 3 - - - Server - - - groupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - 303, 17 - - - 75, 23 - - - 5 - - - &OK - - - btnOK - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 1 - - - Bottom - - - 0, 231 - - - 547, 60 - - - 7 - - - panel2 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 + + 17, 17 Top @@ -507,82 +303,64 @@ 6 - - panel1 + + Bottom - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0, 231 - - $this + + 547, 60 - - 2 + + 7 - - 17, 17 - - - 235, 22 + + 127, 27 - - Import URL from clipboard + + 359, 21 - - 162, 21 + + 1 - - Import configuration file + + 127, 117 - - 0, 0 + + * - - 547, 25 + + 278, 21 - - 8 + + 24 - - menuServer + + 127, 56 - - System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 194, 21 - - $this - - + 3 - - True - - - 6, 12 + + 127, 154 - - 547, 291 + + 194, 21 - - Edit or add a [Socks] server + + 11 - - MenuItem1 + + 127, 84 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 278, 21 - - menuItemImportClipboard - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AddServer4Form - - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + 26 \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServer4Form.zh-Hans.resx b/v2rayN/v2rayN/Forms/AddServer4Form.zh-Hans.resx index 6a3cc081..71dbe272 100644 --- a/v2rayN/v2rayN/Forms/AddServer4Form.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/AddServer4Form.zh-Hans.resx @@ -117,27 +117,33 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 编辑或添加[Socks]服务器 + 取消(&C) + + 确定(&O) + 服务器 - - - 127, 85 + + 65, 12 - - 12, 89 + + 服务器地址 - - 77, 12 + + *手填,方便识别管理 - - 用户名(可选) + + 65, 12 - - 127, 115 + + 服务器端口 12, 119 @@ -148,8 +154,14 @@ 密码(可选) - - *手填,方便识别管理 + + 12, 89 + + + 77, 12 + + + 用户名(可选) 83, 12 @@ -157,21 +169,6 @@ 别名(remarks) - - 65, 12 - - - 服务器端口 - - - 65, 12 - - - 服务器地址 - - - 确定(&O) - 92, 21 @@ -184,7 +181,10 @@ 从剪贴板导入URL - - 编辑或添加[Socks]服务器 + + 127, 115 + + + 127, 85 \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServerForm.cs b/v2rayN/v2rayN/Forms/AddServerForm.cs index 816b7013..6d09db03 100644 --- a/v2rayN/v2rayN/Forms/AddServerForm.cs +++ b/v2rayN/v2rayN/Forms/AddServerForm.cs @@ -207,9 +207,11 @@ namespace v2rayN.Forms { ClearServer(); - OpenFileDialog fileDialog = new OpenFileDialog(); - fileDialog.Multiselect = false; - fileDialog.Filter = "Config|*.json|All|*.*"; + OpenFileDialog fileDialog = new OpenFileDialog + { + Multiselect = false, + Filter = "Config|*.json|All|*.*" + }; if (fileDialog.ShowDialog() != DialogResult.OK) { return; @@ -256,8 +258,7 @@ namespace v2rayN.Forms { ClearServer(); - string msg; - VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out msg); + VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg); if (vmessItem == null) { UI.Show(msg); diff --git a/v2rayN/v2rayN/Forms/AddServerForm.resx b/v2rayN/v2rayN/Forms/AddServerForm.resx index e519eab6..a303fd74 100644 --- a/v2rayN/v2rayN/Forms/AddServerForm.resx +++ b/v2rayN/v2rayN/Forms/AddServerForm.resx @@ -118,31 +118,32 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 6, 12 + + + 729, 569 + + + True + + + Edit or add a [VMess] server + 396, 17 75, 23 - 4 &Cancel - - btnClose - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 0 - 411, 83 @@ -155,159 +156,17 @@ &Generate - - btnGUID + + 303, 17 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 75, 23 - - groupBox1 + + 5 - - 0 - - - True - - - 285, 203 - - - 113, 12 - - - 22 - - - * Fill in manually - - - label13 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 1 - - - True - - - - NoControl - - - 526, 165 - - - 65, 12 - - - 35 - - - 3)QUIC key - - - label24 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 0 - - - True - - - NoControl - - - 470, 99 - - - 89, 12 - - - 34 - - - 4)QUIC securty - - - label23 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 1 - - - True - - - 205, 11 - - - 113, 12 - - - 32 - - - Default value true - - - label22 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panTlsMore - - - 0 - - - True - - - 12, 11 - - - 83, 12 - - - 31 - - - allowInsecure - - - label21 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panTlsMore - - - 1 + + &OK @@ -327,384 +186,6 @@ 30 - - cmbAllowInsecure - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panTlsMore - - - 2 - - - 284, 189 - - - 338, 35 - - - 33 - - - panTlsMore - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 2 - - - True - - - 469, 83 - - - 203, 12 - - - 29 - - - 3)h2 host Separated by commas (,) - - - label20 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 3 - - - 124, 125 - - - True - - - 396, 54 - - - 28 - - - txtPath - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 4 - - - True - - - 9, 125 - - - 29, 12 - - - 27 - - - Path - - - label19 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 5 - - - True - - - 526, 147 - - - 59, 12 - - - 26 - - - 2)h2 path - - - label18 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 6 - - - True - - - 469, 68 - - - 59, 12 - - - 25 - - - 2)ws host - - - label17 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 7 - - - True - - - 526, 130 - - - 59, 12 - - - 24 - - - 1)ws path - - - label16 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 8 - - - True - - - 469, 53 - - - 215, 12 - - - 23 - - - 1)http host Separated by commas (,) - - - label14 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 9 - - - True - - - 9, 201 - - - 23, 12 - - - 22 - - - TLS - - - label15 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 10 - - - - - - tls - - - 124, 197 - - - 143, 20 - - - 21 - - - cmbStreamSecurity - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 11 - - - True - - - 282, 34 - - - 299, 12 - - - 20 - - - *tcp or kcp or QUIC camouflage type, default none - - - label12 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 12 - - - 158, 58 - - - True - - - 300, 53 - - - 16 - - - txtRequestHost - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 13 - - - True - - - 9, 34 - - - 95, 12 - - - 19 - - - Camouflage type - - - label11 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 14 - - - True - - - 9, 62 - - - 143, 12 - - - 17 - - - Camouflage domain(host) - - - label10 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 15 - none @@ -735,99 +216,6 @@ 18 - - cmbHeaderType - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 16 - - - Bottom - - - 3, 237 - - - 723, 234 - - - 21 - - - Keep the default value if it is not clear - - - groupBox2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 2 - - - True - - - 353, 175 - - - 113, 12 - - - 15 - - - *Default value tcp - - - label9 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 3 - - - True - - - 353, 147 - - - 119, 12 - - - 14 - - - *Recommended (auto) - - - label8 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 4 - tcp @@ -852,45 +240,6 @@ 12 - - cmbNetwork - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 5 - - - True - - - 12, 175 - - - 167, 12 - - - 13 - - - Transport protocol(network) - - - label7 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 6 - aes-128-gcm @@ -912,284 +261,20 @@ 6 - - cmbSecurity + + - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tls - - groupBox1 + + 124, 197 - - 7 + + 143, 20 - - 127, 199 - - - 143, 21 - - - 11 - - - txtRemarks - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 8 - - - True - - - 12, 203 - - - 95, 12 - - - 10 - - - Alias (remarks) - - - label6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 9 - - - True - - - 12, 147 - - - 173, 12 - - - 8 - - - Encryption method (security) - - - label5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 10 - - - 127, 114 - - - 143, 21 - - - 7 - - - txtAlterId - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 11 - - - True - - - 12, 118 - - - 47, 12 - - - 6 - - - AlterId - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 12 - - - 127, 85 - - - 278, 21 - - - 5 - - - txtId - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 13 - - - True - - - 12, 89 - - - 53, 12 - - - 4 - - - UUID(id) - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 14 - - - 127, 56 - - - 143, 21 - - - 3 - - - txtPort - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 15 - - - True - - - 12, 60 - - - 29, 12 - - - 2 - - - Port - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 16 - - - 127, 27 - - - 359, 21 - - - 1 - - - txtAddress - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 17 - - - True - - - 12, 31 - - - 47, 12 - - - 0 - - - Address - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 18 + + 21 Fill @@ -1206,65 +291,422 @@ Server - - groupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - 303, 17 - - - 75, 23 - - - 5 - - - &OK - - - btnOK - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 1 - - + Bottom - - 0, 509 + + 3, 237 - - 729, 60 + + 723, 234 - - 7 + + 21 - - panel2 + + Keep the default value if it is not clear - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True - - $this + + 12, 31 - - 1 + + 47, 12 + + + 0 + + + Address + + + True + + + 9, 62 + + + 143, 12 + + + 17 + + + Camouflage domain(host) + + + True + + + 9, 34 + + + 95, 12 + + + 19 + + + Camouflage type + + + True + + + 282, 34 + + + 299, 12 + + + 20 + + + *tcp or kcp or QUIC camouflage type, default none + + + True + + + 285, 203 + + + 113, 12 + + + 22 + + + * Fill in manually + + + True + + + 469, 53 + + + 215, 12 + + + 23 + + + 1)http host Separated by commas (,) + + + True + + + 9, 201 + + + 23, 12 + + + 22 + + + TLS + + + True + + + 526, 130 + + + 59, 12 + + + 24 + + + 1)ws path + + + True + + + 469, 68 + + + 59, 12 + + + 25 + + + 2)ws host + + + True + + + 526, 147 + + + 59, 12 + + + 26 + + + 2)h2 path + + + True + + + 9, 125 + + + 29, 12 + + + 27 + + + Path + + + True + + + 12, 60 + + + 29, 12 + + + 2 + + + Port + + + True + + + 469, 83 + + + 203, 12 + + + 29 + + + 3)h2 host Separated by commas (,) + + + True + + + 12, 11 + + + 83, 12 + + + 31 + + + allowInsecure + + + True + + + 205, 11 + + + 113, 12 + + + 32 + + + Default value true + + + True + + + NoControl + + + 470, 99 + + + 89, 12 + + + 34 + + + 4)QUIC securty + + + True + + + NoControl + + + 526, 165 + + + 65, 12 + + + 35 + + + 3)QUIC key + + + True + + + 12, 89 + + + 53, 12 + + + 4 + + + UUID(id) + + + True + + + 12, 118 + + + 47, 12 + + + 6 + + + AlterId + + + True + + + 12, 147 + + + 173, 12 + + + 8 + + + Encryption method (security) + + + True + + + 12, 203 + + + 95, 12 + + + 10 + + + Alias (remarks) + + + True + + + 12, 175 + + + 167, 12 + + + 13 + + + Transport protocol(network) + + + True + + + 353, 147 + + + 119, 12 + + + 14 + + + *Recommended (auto) + + + True + + + 353, 175 + + + 113, 12 + + + 15 + + + *Default value tcp + + + 162, 21 + + + Import configuration file + + + 237, 22 + + + Import client configuration + + + 237, 22 + + + Import URL from clipboard + + + 237, 22 + + + Import server configuration + + + 0, 0 + + + 729, 25 + + + 8 + + + 17, 17 Top @@ -1278,115 +720,97 @@ 6 - - panel1 + + Bottom - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0, 509 - - $this + + 729, 60 - - 2 + + 7 - - 17, 17 - - - 237, 22 + + 284, 189 - - Import client configuration + + 338, 35 - - 237, 22 - - - Import server configuration + + 33 234, 6 - - 237, 22 + + 127, 27 - - Import URL from clipboard + + 359, 21 - - 162, 21 + + 1 - - Import configuration file + + 127, 114 - - 0, 0 + + 143, 21 - - 729, 25 + + 7 - - 8 + + 127, 85 - - menuServer + + 278, 21 - - System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 5 - - $this + + 124, 125 - + + True + + + 396, 54 + + + 28 + + + 127, 56 + + + 143, 21 + + 3 - + + 127, 199 + + + 143, 21 + + + 11 + + + 158, 58 + + True - - - 6, 12 - - 729, 569 + + 300, 53 - - Edit or add a [VMess] server - - - MenuItem1 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MenuItemImportClient - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MenuItemImportServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator1 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MenuItemImportClipboard - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AddServerForm - - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + 16 \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/AddServerForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/AddServerForm.zh-Hans.resx index 7c5b3623..7b21f2b3 100644 --- a/v2rayN/v2rayN/Forms/AddServerForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/AddServerForm.zh-Hans.resx @@ -117,51 +117,63 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 编辑或添加[VMess]服务器 + 取消(&C) - - 服务器 - 生成(&G) - - *手填,方便识别管理 + + 确定(&O) + + + 127, 171 + + + 211, 20 + + + 127, 143 + + + 211, 20 + + + 服务器 不清楚则保持默认值 - - - 95, 12 + + 83, 12 - - 3)QUIC 加密密钥 + + 地址(address) - - 95, 12 + + 89, 12 - - 4)QUIC 加密方式 + + 伪装域名(host) - - 53, 12 + + 89, 12 - - 默认true + + 伪装类型(type) - - 149, 12 + + 197, 12 - - 3)h2 host中间逗号(,)隔开 + + *tcp或kcp或QUIC伪装类型,默认none - - 65, 12 - - - 路径(path) + + *手填,方便识别管理 161, 12 @@ -175,83 +187,11 @@ 底层传输安全 - - 197, 12 - - - *tcp或kcp或QUIC伪装类型,默认none - - - 124, 58 - - - 334, 51 - - - 89, 12 - - - 伪装类型(type) - - - 89, 12 - - - 伪装域名(host) - - - 143, 12 - - - *默认tcp,选错会无法连接 - - - 113, 12 - - - *随便选,建议(auto) - - - 127, 171 - - - 211, 20 - - - 107, 12 - - - 传输协议(network) - - - 127, 143 - - - 211, 20 - - - 83, 12 - - - 别名(remarks) - - - 113, 12 - - - 加密方式(security) - - - 95, 12 - - - 额外ID(alterId) - - + 65, 12 - - 用户ID(id) + + 路径(path) 65, 12 @@ -259,14 +199,71 @@ 端口(port) - + + 149, 12 + + + 3)h2 host中间逗号(,)隔开 + + + 53, 12 + + + 默认true + + + 95, 12 + + + 4)QUIC 加密方式 + + + 95, 12 + + + 3)QUIC 加密密钥 + + + 65, 12 + + + 用户ID(id) + + + 95, 12 + + + 额外ID(alterId) + + + 113, 12 + + + 加密方式(security) + + 83, 12 - - 地址(address) + + 别名(remarks) - - 确定(&O) + + 107, 12 + + + 传输协议(network) + + + 113, 12 + + + *随便选,建议(auto) + + + 143, 12 + + + *默认tcp,选错会无法连接 92, 21 @@ -280,6 +277,12 @@ 导入客户端配置 + + 171, 22 + + + 从剪贴板导入URL + 171, 22 @@ -289,13 +292,10 @@ 168, 6 - - 171, 22 + + 124, 58 - - 从剪贴板导入URL - - - 编辑或添加[VMess]服务器 + + 334, 51 \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index af4b26d1..20c846d0 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.IO; -using System.IO.Compression; using System.Text; using System.Windows.Forms; using v2rayN.Handler; @@ -11,8 +9,6 @@ using v2rayN.Mode; using v2rayN.Base; using v2rayN.Tool; using System.Diagnostics; -using v2rayN.Properties; -using Newtonsoft.Json; namespace v2rayN.Forms { @@ -198,7 +194,7 @@ namespace v2rayN.Forms ListViewItem lvItem = null; if (statistics != null && statistics.Enable) { - var sItem = statistics.Statistic.Find(item_ => item_.itemId == item.getItemId()); + ServerStatItem sItem = statistics.Statistic.Find(item_ => item_.itemId == item.getItemId()); if (sItem != null) { totalUp = Utils.HumanFy(sItem.totalUp); @@ -271,8 +267,10 @@ namespace v2rayN.Forms VmessItem item = config.vmess[k]; string name = item.getSummary(); - ToolStripMenuItem ts = new ToolStripMenuItem(name); - ts.Tag = k; + ToolStripMenuItem ts = new ToolStripMenuItem(name) + { + Tag = k + }; if (config.index.Equals(k)) { ts.Checked = true; @@ -422,8 +420,10 @@ namespace v2rayN.Forms if (config.vmess[index].configType == (int)EConfigType.Vmess) { - var fm = new AddServerForm(); - fm.EditIndex = index; + AddServerForm fm = new AddServerForm + { + EditIndex = index + }; if (fm.ShowDialog() == DialogResult.OK) { //刷新 @@ -433,8 +433,10 @@ namespace v2rayN.Forms } else if (config.vmess[index].configType == (int)EConfigType.Shadowsocks) { - var fm = new AddServer3Form(); - fm.EditIndex = index; + AddServer3Form fm = new AddServer3Form + { + EditIndex = index + }; if (fm.ShowDialog() == DialogResult.OK) { RefreshServers(); @@ -443,8 +445,10 @@ namespace v2rayN.Forms } else if (config.vmess[index].configType == (int)EConfigType.Socks) { - var fm = new AddServer4Form(); - fm.EditIndex = index; + AddServer4Form fm = new AddServer4Form + { + EditIndex = index + }; if (fm.ShowDialog() == DialogResult.OK) { RefreshServers(); @@ -453,8 +457,10 @@ namespace v2rayN.Forms } else { - var fm2 = new AddServer2Form(); - fm2.EditIndex = index; + AddServer2Form fm2 = new AddServer2Form + { + EditIndex = index + }; if (fm2.ShowDialog() == DialogResult.OK) { //刷新 @@ -524,8 +530,10 @@ namespace v2rayN.Forms private void menuAddVmessServer_Click(object sender, EventArgs e) { - AddServerForm fm = new AddServerForm(); - fm.EditIndex = -1; + AddServerForm fm = new AddServerForm + { + EditIndex = -1 + }; if (fm.ShowDialog() == DialogResult.OK) { //刷新 @@ -558,8 +566,7 @@ namespace v2rayN.Forms private void menuRemoveDuplicateServer_Click(object sender, EventArgs e) { - List servers = null; - Utils.DedupServerList(config.vmess, out servers); + Utils.DedupServerList(config.vmess, out List servers, config.keepOlderDedupl); int oldCount = config.vmess.Count; int newCount = servers.Count; if (servers != null) @@ -635,7 +642,7 @@ namespace v2rayN.Forms { GetLvSelectedIndex(); ClearTestResult(); - var statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, actionType, UpdateSpeedtestHandler); + SpeedtestHandler statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, actionType, UpdateSpeedtestHandler); } private void menuExport2ClientConfig_Click(object sender, EventArgs e) @@ -773,9 +780,11 @@ namespace v2rayN.Forms { UI.Show(UIRes.I18N("CustomServerTips")); - OpenFileDialog fileDialog = new OpenFileDialog(); - fileDialog.Multiselect = false; - fileDialog.Filter = "Config|*.json|All|*.*"; + OpenFileDialog fileDialog = new OpenFileDialog + { + Multiselect = false, + Filter = "Config|*.json|All|*.*" + }; if (fileDialog.ShowDialog() != DialogResult.OK) { return; @@ -801,8 +810,10 @@ namespace v2rayN.Forms private void menuAddShadowsocksServer_Click(object sender, EventArgs e) { - var fm = new AddServer3Form(); - fm.EditIndex = -1; + AddServer3Form fm = new AddServer3Form + { + EditIndex = -1 + }; if (fm.ShowDialog() == DialogResult.OK) { //刷新 @@ -814,8 +825,10 @@ namespace v2rayN.Forms private void menuAddSocksServer_Click(object sender, EventArgs e) { - var fm = new AddServer4Form(); - fm.EditIndex = -1; + AddServer4Form fm = new AddServer4Form + { + EditIndex = -1 + }; if (fm.ShowDialog() == DialogResult.OK) { //刷新 @@ -943,7 +956,7 @@ namespace v2rayN.Forms private void notifyMain_MouseClick(object sender, MouseEventArgs e) { - if (e.Button == System.Windows.Forms.MouseButtons.Left) + if (e.Button == MouseButtons.Left) { ShowForm(); } @@ -1021,14 +1034,14 @@ namespace v2rayN.Forms List datas = new List(); for (int i = 0; i < config.vmess.Count; i++) { - var index = statistics.FindIndex(item_ => item_.itemId == config.vmess[i].getItemId()); + int index = statistics.FindIndex(item_ => item_.itemId == config.vmess[i].getItemId()); if (index != -1) { lvServers.Invoke((MethodInvoker)delegate { lvServers.SuspendLayout(); - var indexStart = 9; + int indexStart = 9; lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayDown); lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayUp); lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalDown); @@ -1148,7 +1161,7 @@ namespace v2rayN.Forms for (int k = 0; k < menuSysAgentMode.DropDownItems.Count; k++) { - var item = ((ToolStripMenuItem)menuSysAgentMode.DropDownItems[k]); + ToolStripMenuItem item = ((ToolStripMenuItem)menuSysAgentMode.DropDownItems[k]); item.Checked = (type == k); } @@ -1201,8 +1214,8 @@ namespace v2rayN.Forms try { - var fileName = Utils.GetPath(downloadHandle.DownloadFileName); - var process = Process.Start("v2rayUpgrade.exe", fileName); + string fileName = Utils.GetPath(downloadHandle.DownloadFileName); + Process process = Process.Start("v2rayUpgrade.exe", fileName); if (process.Id > 0) { menuExit_Click(null, null); @@ -1311,7 +1324,7 @@ namespace v2rayN.Forms { if (args.Success) { - var result = args.Msg; + string result = args.Msg; if (Utils.IsNullOrEmpty(result)) { return; @@ -1353,12 +1366,12 @@ namespace v2rayN.Forms private void tsbAbout_Click(object sender, EventArgs e) { - System.Diagnostics.Process.Start(Global.AboutUrl); + Process.Start(Global.AboutUrl); } private void tsbPromotion_Click(object sender, EventArgs e) { - System.Diagnostics.Process.Start($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}"); + Process.Start($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}"); } #endregion @@ -1432,7 +1445,7 @@ namespace v2rayN.Forms if (args.Success) { AppendText(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}"); - var result = Utils.Base64Decode(args.Msg); + string result = Utils.Base64Decode(args.Msg); if (Utils.IsNullOrEmpty(result)) { AppendText(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}"); @@ -1490,7 +1503,7 @@ namespace v2rayN.Forms private void tsbV2rayWebsite_Click(object sender, EventArgs e) { - System.Diagnostics.Process.Start(Global.v2rayWebsiteUrl); + Process.Start(Global.v2rayWebsiteUrl); } } } diff --git a/v2rayN/v2rayN/Forms/MainForm.resx b/v2rayN/v2rayN/Forms/MainForm.resx index 7cf2c348..d221a5c6 100644 --- a/v2rayN/v2rayN/Forms/MainForm.resx +++ b/v2rayN/v2rayN/Forms/MainForm.resx @@ -118,186 +118,73 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Fill - - - 3, 17 + + + 6, 12 - - 327, 17 - - - 355, 22 + + 952, 593 - - Add [VMess] server + + True - - 355, 22 + + 4, 4, 4, 4 - - Add [Shadowsocks] server + + v2rayN - - 355, 22 + + 65 - - Add [Socks] server - - - 355, 22 - - - Add a custom configuration server - - - 355, 22 - - - Import bulk URL from clipboard (Ctrl+V) - - - 355, 22 - - - Scan QR code on the screen (Ctrl+S) - - - 352, 6 - - - 355, 22 - - - Remove selected servers (Delete) - - - 355, 22 - - - Remove duplicate servers - - - 355, 22 - - - Clone selected server - - - 355, 22 - - - Set as active server (Enter) - - - 352, 6 - - - 355, 22 - - - Move to top (T) - - - 355, 22 - - - Up (U) - - - 355, 22 - - - Down (D) - - - 355, 22 - - - Move to bottom (B) - - - 355, 22 - - - Select All (Ctrl+A) - - - 352, 6 - - - 355, 22 - - - Test servers ping (Ctrl+P) - - - 355, 22 - - - Test servers with tcping (Ctrl+O) - - - 355, 22 - - - Test servers real delay (Ctrl+R) - - - 355, 22 - - - Test servers download speed (Ctrl+T) - - - 352, 6 - - - 355, 22 - - - Export selected server for client configuration - - - 355, 22 - - - Export selected server for server configuration - - - 355, 22 - - - Export share URLs to clipboard (Ctrl+C) - - - 355, 22 - - - Export subscription (base64) share to clipboard - - - Magenta - - - 64, 53 - - - Servers - - - ImageAboveText + + 498, 17 356, 534 - - cmsLv + + 327, 17 - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + NoControl + + + 265, 164 + + + 137, 17 + + + Fill + + + 0, 66 + + + 952, 351 + + + 2 + + + Servers list + + + Bottom + + + 0, 417 + + + 952, 176 + + + 4 + + + Informations Fill @@ -325,108 +212,86 @@ 686, 331 - 1 - - lvServers + + 355, 22 - - v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + Add a custom configuration server - - splitContainer1.Panel1 + + 355, 22 - - 0 + + Import bulk URL from clipboard (Ctrl+V) - - splitContainer1.Panel1 + + 264, 22 - - System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Import bulk URL from clipboard - - splitContainer1 + + 355, 22 - - 0 + + Add [Shadowsocks] server - - Fill + + 355, 22 - - 0, 0 + + Add [Socks] server - - 256, 331 + + 355, 22 - - 0 + + Add [VMess] server - - qrCodeControl + + 264, 22 - - v2rayN.Forms.QRCodeControl, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + Copy local PAC URL - - splitContainer1.Panel2 + + 355, 22 - - 0 + + Clone selected server - - splitContainer1.Panel2 + + 264, 22 - - System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Exit - - splitContainer1 + + 355, 22 - - 1 + + Export selected server for client configuration - - 100 + + 355, 22 - - 946, 331 + + Export selected server for server configuration - - 686 + + 355, 22 - - 2 + + Export share URLs to clipboard (Ctrl+C) - - splitContainer1 + + 355, 22 - - System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - - - 17, 17 - - - 137, 17 - - - NoControl - - - 411, 22 - - - Not Enabled Http Proxy + + Export subscription (base64) share to clipboard 411, 22 @@ -446,41 +311,83 @@ Only open Http proxy and clear the proxy settings - - 411, 22 - - - Only open PAC and clear the proxy settings - 411, 22 Only open Http proxy and do nothing + + 411, 22 + + + Only open PAC and clear the proxy settings + 411, 22 Only open PAC and do nothing - - 264, 22 + + 355, 22 - - Http proxy + + Move to bottom (B) - - 264, 22 + + 355, 22 - - Server + + Down (D) - - 264, 22 + + 355, 22 - - Import bulk URL from clipboard + + Move to top (T) + + + 355, 22 + + + Up (U) + + + 411, 22 + + + Not Enabled Http Proxy + + + 355, 22 + + + Test servers ping (Ctrl+P) + + + 355, 22 + + + Test servers real delay (Ctrl+R) + + + 355, 22 + + + Remove duplicate servers + + + 355, 22 + + + Remove selected servers (Delete) + + + 355, 22 + + + Scan QR code on the screen (Ctrl+S) 264, 22 @@ -488,65 +395,410 @@ Scan QR code on the screen - + + 355, 22 + + + Select All (Ctrl+A) + + 264, 22 - - Copy local PAC URL + + Server - - 261, 6 + + 355, 22 - + + Set as active server (Enter) + + + 355, 22 + + + Test servers download speed (Ctrl+T) + + 264, 22 - - Exit + + Http proxy - - 265, 164 + + 355, 22 - - cmsMain - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Test servers with tcping (Ctrl+O) v2rayN + + 17, 17 + True - - 498, 17 - - + + Top + + + 0, 56 + + + 952, 10 + + + 5 + + Fill - - 0, 66 + + 0, 0 - - 952, 351 + + 256, 331 - + + 0 + + + Fill + + + 3, 17 + + + 100 + + + 946, 331 + + + 686 + + 2 - - Servers list + + 3, 151 - - groupBox1 + + 946, 22 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 7 - - $this + + statusStrip1 - - 2 + + 228, 18 + + + 微软雅黑, 8pt + + + 195, 17 + + + 微软雅黑, 8pt + + + 195, 17 + + + 微软雅黑, 8pt + + + 195, 17 + + + 0, 17 + + + 0, 17 + + + 微软雅黑, 8pt + + + 39, 17 + + + HTTP: + + + 0, 17 + + + 微软雅黑, 8pt + + + 33, 17 + + + PAC: + + + False + + + 微软雅黑, 8pt + + + No + + + 220, 17 + + + SPEED Disabled + + + MiddleRight + + + 0, 17 + + + 微软雅黑, 8pt + + + 52, 17 + + + SOCKS5: + + + 352, 6 + + + 6, 56 + + + 6, 56 + + + 184, 6 + + + 390, 6 + + + 261, 6 + + + 352, 6 + + + 6, 56 + + + 6, 56 + + + 352, 6 + + + 6, 56 + + + 6, 56 + + + 352, 6 + + + 187, 22 + + + v2rayN Project + + + 393, 22 + + + Simplify PAC (need to set Core route) + + + Magenta + + + 128, 53 + + + Check for updates + + + ImageAboveText + + + 393, 22 + + + Update v2rayCore + + + 393, 22 + + + v2rayN (this software) + + + 393, 22 + + + Check for updated PAC (need the HTTP proxy are ON) + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAADJJREFUWEftzrENACAIRUFGdVMdTZkAG4zFXfI68kMAAD8ap9lUbpfyaDV19QAA + 8FDEBl3RImu5VcdbAAAAAElFTkSuQmCC + + + + Magenta + + + 52, 53 + + + Close + + + ImageAboveText + + + Magenta + + + 48, 53 + + + Help + + + ImageAboveText + + + 187, 22 + + + Language-[English] + + + 187, 22 + + + 语言-[中文简体] + + + Magenta + + + 58, 53 + + + Settings + + + ImageAboveText + + + Magenta + + + 89, 53 + + + Promotion + + + ImageAboveText + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAATdJREFUWEftloENAiEMRW8ER3AEN9ANdARHcAPdwBF0A91AN9INtC+5JvUCJwWM + mvCTFw3QUiiU65qa/lUTYT6Ato9rJZyERwT6GFNdU+EihCYNwVhsqmgm3AR1fheOAitd9PCfNvp0HDbY + FolV2MmZZCzX9J0FG0TRTlwFdbahIVE7Qe1IR5bYVnXCyr2yO5F1MNUBec25YtjomcCXSxhr9DmrV2Gr + flyL4GSrYcm9tmnEZ7JsAC7DgWr5ydbXA8hOAcVjG8FTD6ocQgvXKrW8MqFWUfc1DAXgmRwVFaJQAHsh + VbYUU87diqWA934sl/TZ7wV2Lesx0gBwsO5/1Sl5PQhLQb+G+E+bfTm9KXsRAVgHrMK+jO9gbNEzzMSh + 6DlM9nANoa+kdCeLXLNLFtc9b2r6EXXdE4e4mdByNuG1AAAAAElFTkSuQmCC + + + + BottomCenter + + + Magenta + + + 98, 53 + + + Restart Service + + + ImageAboveText + + + Magenta + + + 64, 53 + + + Servers + + + ImageAboveText + + + Magenta + + + 99, 53 + + + Subscriptions + + + ImageAboveText + + + 125, 22 + + + Settings + + + 125, 22 + + + Updates + + + 187, 22 + + + V2Ray Website + + + 0, 0 + + + 952, 56 + + + 6 + + + 409, 17 Fill @@ -569,886 +821,4 @@ 2 - - txtMsgBox - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 0 - - - 228, 18 - - - 微软雅黑, 8pt - - - 52, 17 - - - SOCKS5: - - - 0, 17 - - - 微软雅黑, 8pt - - - 195, 17 - - - 微软雅黑, 8pt - - - 39, 17 - - - HTTP: - - - 0, 17 - - - 微软雅黑, 8pt - - - 195, 17 - - - 微软雅黑, 8pt - - - 33, 17 - - - PAC: - - - 0, 17 - - - 微软雅黑, 8pt - - - 195, 17 - - - False - - - 微软雅黑, 8pt - - - No - - - 220, 17 - - - SPEED Disabled - - - MiddleRight - - - 0, 17 - - - 3, 151 - - - 946, 22 - - - 7 - - - statusStrip1 - - - ssMain - - - System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 1 - - - Bottom - - - 0, 417 - - - 952, 176 - - - 4 - - - Informations - - - groupBox2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - Top - - - 0, 56 - - - 952, 10 - - - 5 - - - panel1 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - 409, 17 - - - 6, 56 - - - 125, 22 - - - Settings - - - 125, 22 - - - Updates - - - Magenta - - - 99, 53 - - - Subscriptions - - - ImageAboveText - - - 6, 56 - - - Magenta - - - 58, 53 - - - Settings - - - ImageAboveText - - - 6, 56 - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd - QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X - jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY - 6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3 - NQwF4JkcFRWiUAB7IVW2FFPO3YqlgPd+LJf02e8Fdi3rMdIAcLDuf9UpeT0IS0G/hvhPm305vSl7EQFY - B6zCvozvYGzRM8zEoeg5TPZwDaGvpHQni1yzSxbXPW9q+hF13ROHuJnQcjbhtQAAAABJRU5ErkJggg== - - - - BottomCenter - - - Magenta - - - 98, 53 - - - Restart Service - - - ImageAboveText - - - 6, 56 - - - 393, 22 - - - v2rayN (this software) - - - 393, 22 - - - Update v2rayCore - - - 393, 22 - - - Check for updated PAC (need the HTTP proxy are ON) - - - 390, 6 - - - 393, 22 - - - Simplify PAC (need to set Core route) - - - Magenta - - - 128, 53 - - - Check for updates - - - ImageAboveText - - - 6, 56 - - - 187, 22 - - - v2rayN Project - - - 187, 22 - - - V2Ray Website - - - 184, 6 - - - 187, 22 - - - Language-[English] - - - 187, 22 - - - 语言-[中文简体] - - - Magenta - - - 48, 53 - - - Help - - - ImageAboveText - - - Magenta - - - 89, 53 - - - Promotion - - - ImageAboveText - - - 6, 56 - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/ - GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg== - - - - Magenta - - - 52, 53 - - - Close - - - ImageAboveText - - - 0, 0 - - - 952, 56 - - - 6 - - - tsMain - - - System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - True - - - 65 - - - 6, 12 - - - 952, 593 - - - 4, 4, 4, 4 - - - v2rayN - - - menuAddVmessServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuAddShadowsocksServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuAddSocksServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuAddCustomServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuAddServers - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuScanScreen - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator1 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuRemoveServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuRemoveDuplicateServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuCopyServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuSetDefaultServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator3 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuMoveTop - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuMoveUp - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuMoveDown - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuMoveBottom - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuSelectAll - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator9 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuPingServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuTcpingServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuRealPingServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuSpeedServer - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator6 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuExport2ClientConfig - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuExport2ServerConfig - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuExport2ShareUrl - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuExport2SubContent - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbServer - - - System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - notifyMain - - - System.Windows.Forms.NotifyIcon, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuSysAgentMode - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuNotEnabledHttp - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuGlobal - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuGlobalPAC - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuKeep - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuKeepPAC - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuKeepNothing - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuKeepPACNothing - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuServers - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuAddServers2 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuScanScreen2 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuCopyPACUrl - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator2 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuExit - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - bgwScan - - - System.ComponentModel.BackgroundWorker, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslSocksPortLab - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslSocksPort - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslBlank1 - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslHttpPortLab - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslHttpPort - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslBlank2 - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslPacPortLab - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslPacPort - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslBlank3 - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslServerSpeed - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolSslBlank4 - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator4 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbSub - - - System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbSubSetting - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbSubUpdate - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator8 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbOptionSetting - - - System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator5 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbReload - - - System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator7 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbCheckUpdate - - - System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbCheckUpdateN - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbCheckUpdateCore - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbCheckUpdatePACList - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator13 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbCheckClearPACList - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator10 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbHelp - - - System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbAbout - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbV2rayWebsite - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator12 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbLanguageDef - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbLanguageZhHans - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbPromotion - - - System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripSeparator11 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tsbClose - - - System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MainForm - - - 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/MainForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx index 1fdca7f8..3b7d84b5 100644 --- a/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx @@ -118,23 +118,34 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 300, 22 + + 301, 534 - - 添加[VMess]服务器 + + 196, 142 - - 300, 22 + + 服务器列表 - - 添加[Shadowsocks]服务器 + + 信息 - - 300, 22 - - - 添加[Socks]服务器 + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 + ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu + PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA + BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 + bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp + bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz + dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA + CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp + bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5 + bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3 + ////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0 + ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw== + 300, 22 @@ -148,26 +159,35 @@ 从剪贴板导入批量URL (Ctrl+V) - + + 195, 22 + + + 从剪贴板导入批量URL + + 300, 22 - - 扫描屏幕上的二维码 (Ctrl+S) + + 添加[Shadowsocks]服务器 - - 297, 6 - - + 300, 22 - - 移除所选服务器(多选) (Delete) + + 添加[Socks]服务器 - + 300, 22 - - 移除重复的服务器 + + 添加[VMess]服务器 + + + 195, 22 + + + 复制本地PAC网址 300, 22 @@ -175,74 +195,11 @@ 克隆所选服务器 - - 300, 22 + + 195, 22 - - 设为活动服务器 (Enter) - - - 297, 6 - - - 300, 22 - - - 上移至顶 (T) - - - 300, 22 - - - 上移 (U) - - - 300, 22 - - - 下移 (D) - - - 300, 22 - - - 下移至底 (B) - - - 300, 22 - - - 全选 (Ctrl+A) - - - 297, 6 - - - 300, 22 - - - 测试服务器延迟Ping(多选) (Ctrl+P) - - - 300, 22 - - - 测试服务器延迟Tcping(多选) (Ctrl+O) - - - 300, 22 - - - 测试服务器真连接延迟(多选) (Ctrl+R) - - - 300, 22 - - - 测试服务器速度(多选) (Ctrl+T) - - - 297, 6 + + 退出 300, 22 @@ -268,38 +225,6 @@ 批量导出订阅内容至剪贴板(多选) - - 73, 53 - - - 服务器 - - - 301, 534 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz - dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA - CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp - bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5 - bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3 - ////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0 - ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw== - - - - 316, 22 - - - 关闭Http代理 - 316, 22 @@ -318,41 +243,83 @@ 仅开启Http代理,并清除系统代理 - - 316, 22 - - - 仅开启PAC,并清除系统代理 - 316, 22 仅开启Http代理,不改变系统代理 + + 316, 22 + + + 仅开启PAC,并清除系统代理 + 316, 22 仅开启PAC,不改变系统代理 - - 195, 22 + + 300, 22 - - Http代理 + + 下移至底 (B) - - 195, 22 + + 300, 22 - - 服务器 + + 下移 (D) - - 195, 22 + + 300, 22 - - 从剪贴板导入批量URL + + 上移至顶 (T) + + + 300, 22 + + + 上移 (U) + + + 316, 22 + + + 关闭Http代理 + + + 300, 22 + + + 测试服务器延迟Ping(多选) (Ctrl+P) + + + 300, 22 + + + 测试服务器真连接延迟(多选) (Ctrl+R) + + + 300, 22 + + + 移除重复的服务器 + + + 300, 22 + + + 移除所选服务器(多选) (Delete) + + + 300, 22 + + + 扫描屏幕上的二维码 (Ctrl+S) 195, 22 @@ -360,50 +327,114 @@ 扫描屏幕上的二维码 - + + 300, 22 + + + 全选 (Ctrl+A) + + 195, 22 - - 复制本地PAC网址 + + 服务器 - - 192, 6 + + 300, 22 - + + 设为活动服务器 (Enter) + + + 300, 22 + + + 测试服务器速度(多选) (Ctrl+T) + + 195, 22 - - 退出 + + Http代理 - - 196, 142 + + 300, 22 - - 服务器列表 + + 测试服务器延迟Tcping(多选) (Ctrl+O) 网速显示未启用 - - 信息 + + 297, 6 - - 124, 22 + + 220, 6 - - 订阅设置 + + 192, 6 - - 124, 22 + + 297, 6 - - 更新订阅 + + 297, 6 - - 61, 53 + + 297, 6 - - 订阅 + + v2rayN 项目 + + + 223, 22 + + + 简化PAC (请设置Core路由) + + + 85, 53 + + + 检查更新 + + + 223, 22 + + + v2rayCore + + + 223, 22 + + + v2rayN + + + 223, 22 + + + PAC + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/ + GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg== + + + + 76, 53 + + + 关闭窗口 + + + 69, 53 + + + 帮助 76, 53 @@ -411,6 +442,12 @@ 参数设置 + + 68, 53 + + + 推广 + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -428,68 +465,31 @@ 重启服务 - - 223, 22 + + 73, 53 - - v2rayN + + 服务器 - - 223, 22 + + 61, 53 - - v2rayCore + + 订阅 - - 223, 22 + + 124, 22 - - PAC + + 订阅设置 - - 220, 6 + + 124, 22 - - 223, 22 - - - 简化PAC (请设置Core路由) - - - 85, 53 - - - 检查更新 - - - v2rayN 项目 + + 更新订阅 V2Ray 官网 - - 69, 53 - - - 帮助 - - - 68, 53 - - - 推广 - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/ - GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg== - - - - 76, 53 - - - 关闭窗口 - \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs index 8799a79c..797915f1 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs @@ -84,6 +84,7 @@ this.txtKcpmtu = new System.Windows.Forms.TextBox(); this.label6 = new System.Windows.Forms.Label(); this.tabPage7 = new System.Windows.Forms.TabPage(); + this.chkKeepOlderDedupl = new System.Windows.Forms.CheckBox(); this.cbFreshrate = new System.Windows.Forms.ComboBox(); this.lbFreshrate = new System.Windows.Forms.Label(); this.chkEnableStatistics = new System.Windows.Forms.CheckBox(); @@ -510,6 +511,7 @@ // tabPage7 // resources.ApplyResources(this.tabPage7, "tabPage7"); + this.tabPage7.Controls.Add(this.chkKeepOlderDedupl); this.tabPage7.Controls.Add(this.cbFreshrate); this.tabPage7.Controls.Add(this.lbFreshrate); this.tabPage7.Controls.Add(this.chkEnableStatistics); @@ -520,6 +522,12 @@ this.tabPage7.Name = "tabPage7"; this.tabPage7.UseVisualStyleBackColor = true; // + // chkKeepOlderDedupl + // + resources.ApplyResources(this.chkKeepOlderDedupl, "chkKeepOlderDedupl"); + this.chkKeepOlderDedupl.Name = "chkKeepOlderDedupl"; + this.chkKeepOlderDedupl.UseVisualStyleBackColor = true; + // // cbFreshrate // resources.ApplyResources(this.cbFreshrate, "cbFreshrate"); @@ -714,5 +722,6 @@ private System.Windows.Forms.TextBox txtuserPacRule; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Label label4; + private System.Windows.Forms.CheckBox chkKeepOlderDedupl; } } \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.cs index 890041ab..c1152594 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.cs @@ -77,8 +77,7 @@ namespace v2rayN.Forms { //路由 cmbdomainStrategy.Text = config.domainStrategy; - int routingMode = 0; - int.TryParse(config.routingMode, out routingMode); + int.TryParse(config.routingMode, out int routingMode); cmbroutingMode.SelectedIndex = routingMode; txtUseragent.Text = Utils.List2String(config.useragent, true); @@ -112,13 +111,13 @@ namespace v2rayN.Forms txturlGFWList.Text = config.urlGFWList; chkAllowLANConn.Checked = config.allowLANConn; + chkEnableStatistics.Checked = config.enableStatistics; + chkKeepOlderDedupl.Checked = config.keepOlderDedupl; - var enableStatistics = config.enableStatistics; - chkEnableStatistics.Checked = enableStatistics; - var cbSource = new ComboItem[] + ComboItem[] cbSource = new ComboItem[] { new ComboItem{ID = (int)Global.StatisticsFreshRate.quick, Text = UIRes.I18N("QuickFresh")}, new ComboItem{ID = (int)Global.StatisticsFreshRate.medium, Text = UIRes.I18N("MediumFresh")}, @@ -340,9 +339,10 @@ namespace v2rayN.Forms config.allowLANConn = chkAllowLANConn.Checked; - var lastEnableStatistics = config.enableStatistics; + bool lastEnableStatistics = config.enableStatistics; config.enableStatistics = chkEnableStatistics.Checked; config.statisticsFreshRate = (int)cbFreshrate.SelectedValue; + config.keepOlderDedupl = chkKeepOlderDedupl.Checked; //if(lastEnableStatistics != config.enableStatistics) //{ @@ -389,25 +389,25 @@ namespace v2rayN.Forms txtUserblock.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.blockTag); cmbroutingMode.SelectedIndex = 3; - var lstUrl = new List(); + List lstUrl = new List(); lstUrl.Add(Global.CustomRoutingListUrl + Global.agentTag); lstUrl.Add(Global.CustomRoutingListUrl + Global.directTag); lstUrl.Add(Global.CustomRoutingListUrl + Global.blockTag); - var lstTxt = new List(); + List lstTxt = new List(); lstTxt.Add(txtUseragent); lstTxt.Add(txtUserdirect); lstTxt.Add(txtUserblock); for (int k = 0; k < lstUrl.Count; k++) { - var txt = lstTxt[k]; + TextBox txt = lstTxt[k]; DownloadHandle downloadHandle = new DownloadHandle(); downloadHandle.UpdateCompleted += (sender2, args) => { if (args.Success) { - var result = args.Msg; + string result = args.Msg; if (Utils.IsNullOrEmpty(result)) { return; diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.resx index 0bf6ffbf..7a289ee6 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.resx @@ -118,1890 +118,1074 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - 11 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 1 - - - 30, 176 - - - Record local logs - - - 634, 460 - - - 12 - - - 4, 22 - - - txtKcpwriteBufferSize - - - groupBox1 - - - 1 - - - False - - - 17 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControl1 - - - groupBox1 - - - 5 - - - 94, 21 - - - 9 - - - groupBox1 - - - label15 - - - tabPage9 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 13 - - - 468, 60 - - - Top - - - 15, 16 - - - 6 - - - txtKcptti - - - tabPage3 - - - 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 - - - tabPage6 - - - 84, 16 - - - tabPage9 - - - 628, 454 - - - tabPage7 - - - Only open PAC, do not automatically configure PAC - - - 12 - - - 662, 60 - - - 20 - - - http - - - 7 - - - label5 - - - 648, 573 - - - Core: KCP settings - - - 206, 64 - - - 95, 12 - - - tabPage6 - - - 14 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Only open PAC and do nothing - - - 15, 63 - - - tabControl2 - - - 16 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - Enable UDP - - - 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 - - - tabPage6 - - - Only open Http proxy, do not automatically configure proxy server (direct mode) - - - 4 - - - tabPage6 - - - False - - - tabControl2 - - - 0 - - - $this - - - 6 - - - 2 - - - 3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - 0 - - - tabPage6 - - - 3 - - - 18 - - - True - - - Fill - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - congestion - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - panel3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3, 3, 3, 3 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 89, 12 - - - info - - - txtUseragent - - - 1 - - - tabPage7 - - - v2rayN settings - - - 19 - - - 15 - - - Not Enabled Http Proxy - - - 13 - - - 32 - - - 628, 454 - 6, 12 - - groupBox1 + + 662, 675 - - 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 - - - Boot automatically - - - 654, 579 - - - 3, 3, 3, 3 - - - 1 - - - Http proxy - - - 4 - - - Turn on Sniffing - - - tabPage6 - - - 355, 16 - - - 3, 3, 3, 3 - - - 97, 20 - - - 3 - - - 5, 14 - - - 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 - - - 9 - - - 598, 16 - - - 654, 579 - - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - warning - - - groupBox1 - - - 0 - - - tabPage7 - - + True - - Statistics freshrate - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 120, 16 - - - 20 - - - 89, 12 - - - Only open Http proxy and do nothing - - - 120, 16 - - - 18, 66 - - - 20, 143 - - - 11 - 4, 4, 4, 4 - - tabPage6 + + Settings - - btnClose + + 355, 16 - - Turn on Sniffing + + 75, 23 - - cmbloglevel + + 7 - - groupBox1 + + &Cancel - - 18, 28 + + 267, 16 - - 34 + + 75, 23 - - 20 + + 8 + + + &OK + + + 322, 10 + + + 229, 23 + + + 18 + + + Set default custom routing rules + + + 161, 84 + + + 58, 20 + + + 32 + + + True + + + 15, 63 + + + 120, 16 + + + 19 + + + listening port 2 + + + False + + + True + + + 15, 38 + + + 204, 16 29 - - 0 + + Allow connections from the LAN - - 21, 17 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - label16 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 14 - - - 19 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - *Set user pac rules, separated by commas (,) - - + True - - chksniffingEnabled + + 15, 16 - - 5 + + 132, 16 - - 174, 16 + + 23 - - 16 + + Boot automatically - - 30, 92 + + True - - groupBox1 + + NoControl - - 18, 104 - - - tabPage2 - - - 97, 20 - - - socks - - - tabPage5 + + 15, 62 558, 16 - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 29 - - 464, 20 + + Enable Statistics(Realtime net speed and traffic data amount. Need restart v2rayN client) - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 20, 143 - - tabPage6 + + 84, 16 - - *Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP + + 20 - - tabPage3 + + congestion - - 30 + + True - - 53, 12 + + NoControl - - 16 + + 15, 110 - - label8 + + 198, 16 - - 468, 27 + + 33 - - label13 + + Keep older when deduplication - - chkAutoRun + + True - - 65, 12 + + 15, 160 - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 126, 16 - - 3 + + 9 - - 14 + + Record local logs - - 12 + + True 15, 129 - - chkudpEnabled + + 174, 16 - - 345, 24 + + 20 + + + Turn on Mux Multiplexing + + + True + + + NoControl + + + 468, 27 + + + 120, 16 + + + 31 + + + Turn on Sniffing + + + True + + + NoControl + + + 468, 60 + + + 120, 16 + + + 32 + + + Turn on Sniffing + + + False + + + True + + + 369, 27 + + + 84, 16 + + + 10 + + + Enable UDP + + + True + + + 369, 62 + + + 84, 16 + + + 18 + + + Enable UDP + + + False + + + AsIs + + + IPIfNonMatch + + + IPOnDemand + + + 115, 10 + + + 165, 20 + + + 16 + + + Not Enabled Http Proxy + + + Open Http proxy and automatically configure proxy server (global mode) + + + Open PAC and automatically configure PAC (PAC mode) + + + Only open Http proxy, do not automatically configure proxy server (direct mode) + + + Only open PAC, do not automatically configure PAC + + + Only open Http proxy and do nothing + + + Only open PAC and do nothing + + + 124, 94 + + + 464, 20 + + + 33 + + + debug + + + info + + + warning + + + error + + + none + + + 257, 158 + + + 97, 20 + + + 6 + + + False + + + socks + + + http + + + 257, 25 + + + 97, 20 + + + 12 + + + socks + + + http + + + 257, 60 + + + 97, 20 + + + 17 + + + False + + + Global + + + Bypassing the LAN address + + + Bypass mainland address + + + Bypassing LAN and mainland address + + + 21, 17 + + + 255, 20 + + + 14 + + + Fill + + + 3, 3 + + + 648, 573 + + + 6 + + + Fill + + + 3, 3 + + + 648, 573 + + + 12 + + + True + + + 206, 29 + + + 53, 12 + + + 11 + + + protocol True + + 236, 104 + + + 95, 12 + + + 14 + + + writeBufferSize + + + True + + + 18, 104 + + + 89, 12 + + + 12 + + + readBufferSize + + + True + + + 30, 176 + + + 431, 12 + + + 27 + + + Custom GFWList address (please fill in the blank without customization) + + + True + 33, 204 - - tabPage1 - - - 5 - - - tabPage6 - - - 2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4 - - - btnSetDefRountingRule - - - True - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - label1 - - - 84, 16 - - - tabPage8 - - - True - - - False - - - label7 - - - 4, 22 - - - txtlocalPort - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage7 - - - 3, 17 - - - 4, 22 - - - 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 - - - 84, 16 - - - Turn on Mux Multiplexing - - - 23, 12 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 97, 20 - - - 555, 100 - - - socks - - - 3, 3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - chkAllowLANConn - - - 4, 22 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControl1 - - - 1 - - - True - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 15, 38 - - - 2 - - - 10 - - - 369, 62 - - - 12 - - - 1.Proxy Domain or IP - - - panel3 - - - NoControl - - - 654, 579 - - - tabControl2 - - - 7 - - - 7 - - - http - - - 53, 12 - - - 1 - - - 2 - - - 0 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage6 - - - label2 - - - 165, 20 - - - False - - - 0 - - - 3, 3 - - - 9 - - - groupBox1 - - - 4.Pre-defined rules - - - 101, 12 - - - 2 - - - 12 - - - 431, 12 - - - cmbprotocol - - - 648, 37 - - - True - - - Enable Statistics(Realtime net speed and traffic data amount. Need restart v2rayN client) - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4 - - - Listening port - - - Vertical - - - Fill - - - 1 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Vertical - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 28 - - - 257, 60 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControl1 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - cmbprotocol2 - - - Open Http proxy and automatically configure proxy server (global mode) - - - groupBox2 - - - True - - - 94, 21 - - - mtu - - - True - - - panel4 - - - True - - - chkKcpcongestion - - - 0 - - - 0 - - - 257, 25 - - - 3, 84 - - - groupBox1 - - - Top - - - listening port 2 - - - 11 - - - chkAllowIn2 - - - tabPage2 - - - 14 - - - True - - - True - - - 19 - - - 3 - - - tabPage4 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4 - - - 541, 100 - - - panel3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - error - - - True - - - txtuserPacRule - - - 59, 12 - - - groupBox1 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 634, 460 - - - 11 - - - tabControl1 - - - 662, 10 - - - txtlocalPort2 - - - True - - - tabPage7 - - - 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 - - - tabPage6 - - - tabControl2 - - - txtKcpreadBufferSize - - - 3 - - - panel2 - - - 30 - - - 8 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - User PAC settings - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage7 - - - 9 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Log level - - - tabControl1 - - - protocol - - - 6 - - - tabPage4 - - - NoControl - - - 2 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AsIs - - - 15, 62 - - - 6 - - - tabPage7 - - - 642, 486 - - - 4, 22 - - - 58, 20 - - - 1 - - - 42, 98 - - - 13 - - - 13 - - - 2 - - - downlinkCapacity - - - 78, 21 - - - True - - - True - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - cmbroutingMode - - - 3, 3 - - - 1 - - - 23, 12 - - - True - - - 8 - - - True - - - 3, 3, 3, 3 - - - 17 - - - 345, 100 - - - 94, 21 - - - 75, 23 - - - True - - - 10 - - - 204, 16 - - - 17 - - - 94, 21 - - - debug - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 5 - - - 0, 615 - - - 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 - - - Custom GFWList address (please fill in the blank without customization) - - - 18 - - - 255, 20 - - - NoControl - - - 4, 22 - - - cmbdomainStrategy - - - OptionSettingForm - - - NoControl - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - &OK - - - 10 - - - 3, 40 - - - panel2 - - - txtKcpuplinkCapacity - - - 115, 10 - - - 23 - - - chklogEnabled - - - chksniffingEnabled2 - - - 1 - - - 642, 67 - - - 0 - - - 4, 22 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Domain strategy - - - tabPage5 - - - 8 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - IPIfNonMatch - - - groupBox1 - - - groupBox1 - - - 0 - - - 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 - - - 654, 579 - - - True - - - 33 - - - 3 - - - 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 - - - 193, 162 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - groupBox1 - - - groupBox1 - - - 32 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel4 - - - Core: Routing settings + + 281, 12 29 - - Fill + + Custom DNS (multiple, separated by commas (,)) - + True - - 3, 3 - - - 257, 158 - - - tabPage8 - - - 2 - - - 236, 104 - - - 4 - - - Open PAC and automatically configure PAC (PAC mode) - - - 125, 12 - - + NoControl - - tabPage9 - - - 94, 21 - - - 75, 23 - - - True - - - 33, 228 - - - 345, 62 - - - uplinkCapacity - - - 662, 675 - - - chkEnableStatistics - - - IPOnDemand - - - True - - - 6 - - - 0 - - - 0 - - - Settings - - - 0 - - - 3, 3, 3, 3 - - - 3, 3 - - - 32, 205 - - - 634, 460 - - - 111, 62 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - label4 - - - 628, 454 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 124, 94 - - - btnOK - - - Set default custom routing rules - - - tabPage6 - - - txturlGFWList - - - chkmuxEnabled - - - none - - - tabPage6 - - - False - - - 4, 22 - - - 5, 11 - - - 0 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0, 0 - - - Enable UDP - - - 15, 160 - - - 3, 3, 3, 3 - - - groupBox1 - - - 18 - - - 126, 16 - - - 267, 16 - - - Global - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 5, 14 95, 12 - - groupBox1 + + 17 - - Fill + + Domain strategy - + + True + + + NoControl + + + 42, 98 + + + 65, 12 + + + 34 + + + Http proxy + + + True + + + 33, 29 + + + 89, 12 + + + 2 + + + Listening port + + + True + + + 206, 64 + + + 53, 12 + + + 16 + + + protocol + + False - - readBufferSize + + NoControl - - 9 + + 5, 11 - - 0 + + 598, 16 - - 322, 10 + + 13 - - groupBox1 + + *Set user pac rules, separated by commas (,) - - 0 + + True - - 94, 21 + + 193, 162 - - 3 + + 59, 12 - - 3 + + 8 - - 3, 3, 3, 3 + + Log level + + + True + + + 18, 28 + + + 23, 12 + + + 4 + + + mtu + + + True 236, 28 + + 23, 12 + + + 6 + + + tti + + + True + + + 236, 66 + + + 101, 12 + + + 10 + + + downlinkCapacity + + + True + + + 18, 66 + + + 89, 12 + + + 8 + + + uplinkCapacity + + + 5, 45 + + + 598, 16 + + + 13 + + + *Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP + + + True + + + NoControl + + + 30, 87 + + + 125, 12 + + + 30 + + + Statistics freshrate + + + Top + + + 0, 0 + + + 662, 10 + + + 9 + Bottom - - 2.Direct Domain or IP + + 0, 615 - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 662, 60 - - groupBox1 + + 11 - - NoControl + + Top - - 3, 3, 3, 3 + + 3, 17 - - 10 + + 642, 67 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 19 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Top - - 124, 60 + + 3, 3 - - cbFreshrate + + 648, 37 - - 132, 16 + + 20 - - tabPage6 - - - label6 - - - 111, 24 - - - panel2 - - - 21 - - - label9 + + Fill 0, 10 - - panel1 + + 662, 605 - + + 10 + + + Fill + + + 3, 84 + + + 642, 486 + + + 12 + + + 4, 22 + + + 3, 3, 3, 3 + + + 654, 579 + + + 0 + + + Core: basic settings + + + 4, 22 + + + 3, 3, 3, 3 + + + 654, 579 + + + 1 + + + Core: Routing settings + + + 4, 22 + + + 3, 3, 3, 3 + + + 634, 460 + + + 0 + + + 1.Proxy Domain or IP + + + 4, 22 + + + 3, 3, 3, 3 + + + 634, 460 + + + 1 + + + 2.Direct Domain or IP + + + 4, 22 + + + 3, 3, 3, 3 + + + 634, 460 + + 2 - - label14 + + 3.Block Domain or IP - + + 4, 22 + + + 3, 3, 3, 3 + + + 654, 579 + + + 2 + + + Core: KCP settings + + + 4, 22 + + + 3, 3, 3, 3 + + + 654, 579 + + + 3 + + + v2rayN settings + + + 4, 22 + + + 3, 3, 3, 3 + + + 634, 460 + + + 3 + + + 4.Pre-defined rules + + + 4, 22 + + + 3, 3, 3, 3 + + + 654, 579 + + + 4 + + + User PAC settings + + + 345, 62 + + + 94, 21 + + + 11 + + + 111, 24 + + + 94, 21 + + + 5 + + + 111, 100 + + + 94, 21 + + + 13 + + + 345, 24 + + + 94, 21 + + + 7 + + + 111, 62 + + + 94, 21 + + + 9 + + + 345, 100 + + + 94, 21 + + + 15 + + + 124, 25 + + + 78, 21 + + + 3 + + + 124, 60 + + + 78, 21 + + + 14 + + + False + + + 33, 228 + + True - + + + 555, 100 + + + 30 + + + 32, 205 + + + True + + + 541, 100 + + + 28 + + + Fill + + + 3, 3 + + + 0 + + + True + + + Vertical + + + 628, 454 + + + 0 + + + Fill + + + 3, 3 + + + 0 + + + True + + + Vertical + + + 628, 454 + + + 1 + + + Fill + + + 3, 3 + + + 0 + + + True + + + Vertical + + + 628, 454 + + + 1 + + + Fill + + + 3, 40 + + + 0 + + + True + + + Vertical + + + 648, 536 + + + 21 + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx index 97b2cf9d..f59095a3 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx @@ -117,15 +117,95 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + 参数设置 + 取消(&C) - - - 53, 12 + + 确定(&O) - - Http代理 + + NoControl + + + 351, 14 + + + 201, 23 + + + 一键设置默认自定义路由规则 + + + 102, 16 + + + 本地监听端口2 + + + 144, 16 + + + 允许来自局域网的连接 + + + 180, 16 + + + 开机自动启动(可能会不成功) + + + 384, 16 + + + 启用统计(实时网速显示和使用流量显示,需要重启v2rayN客户端) + + + 去重时保留序号较小的项 + + + 156, 16 + + + 记录本地日志(默认关闭) + + + 开启Mux多路复用(默认开启) + + + 96, 16 + + + 开启流量探测 + + + 96, 16 + + + 开启流量探测 + + + 66, 16 + + + 开启UDP + + + 66, 16 + + + 开启UDP + + + 81, 14 + + + 186, 20 关闭Http代理 @@ -148,105 +228,6 @@ 仅开启PAC,不改变系统代理 - - 96, 16 - - - 开启流量探测 - - - 96, 16 - - - 开启流量探测 - - - 191, 12 - - - 自定义DNS(可多个,用逗号(,)隔开) - - - 开启Mux多路复用(默认开启) - - - 102, 16 - - - 本地监听端口2 - - - 66, 16 - - - 开启UDP - - - 29, 12 - - - 协议 - - - 29, 12 - - - 协议 - - - 66, 16 - - - 开启UDP - - - 156, 16 - - - 记录本地日志(默认关闭) - - - 53, 12 - - - 日志等级 - - - 77, 12 - - - 本地监听端口 - - - Core:基础设置 - - - 628, 449 - - - 634, 455 - - - 1.代理的Domain或IP - - - 628, 449 - - - 634, 455 - - - 2.直连的Domain或IP - - - 628, 449 - - - 634, 455 - - - 3.阻止的Domain或IP - 全局 @@ -265,32 +246,57 @@ 244, 20 - - 634, 455 + + 29, 12 - - 4.预定义规则 + + 协议 - - 3, 89 + + 227, 12 - - 642, 481 + + 自定义GFWList地址(不需自定义请填空白) - - - NoControl + + 191, 12 - - 351, 14 + + 自定义DNS(可多个,用逗号(,)隔开) - - 201, 23 + + 53, 12 - - 一键设置默认自定义路由规则 + + 域名策略 + + + 53, 12 + + + Http代理 + + + 77, 12 + + + 本地监听端口 + + + 29, 12 + + + 协议 + + + *设置用户PAC规则,用逗号(,)隔开 + + + 53, 12 + + + 日志等级 - True @@ -303,70 +309,67 @@ *设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP - - 81, 14 - - - 186, 20 - - - 53, 12 - - - 域名策略 - - - 642, 72 - - - Core:路由设置 - - - Core:KCP设置 - 77, 12 统计刷新频率 - - 384, 16 + + 642, 72 - - 启用统计(实时网速显示和使用流量显示,需要重启v2rayN客户端) + + 3, 89 - - 144, 16 + + 642, 481 - - 允许来自局域网的连接 + + Core:基础设置 - - 227, 12 + + Core:路由设置 - - 自定义GFWList地址(不需自定义请填空白) + + 634, 455 - - 180, 16 + + 1.代理的Domain或IP - - 开机自动启动(可能会不成功) + + 634, 455 + + + 2.直连的Domain或IP + + + 634, 455 + + + 3.阻止的Domain或IP + + + Core:KCP设置 v2rayN设置 - - *设置用户PAC规则,用逗号(,)隔开 + + 634, 455 + + + 4.预定义规则 用户PAC设置 - - 确定(&O) + + 628, 449 - - 参数设置 + + 628, 449 + + + 628, 449 \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/QRCodeControl.resx b/v2rayN/v2rayN/Forms/QRCodeControl.resx index 29882d55..d4e9e4a4 100644 --- a/v2rayN/v2rayN/Forms/QRCodeControl.resx +++ b/v2rayN/v2rayN/Forms/QRCodeControl.resx @@ -117,106 +117,67 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 - - - 356, 441 - - - 0, 0 - - - 0 + + + 6, 12 - - Sharing panel - - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 356, 16 + + True QRCodeControl - - 356, 355 - - - 0, 371 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Bottom - - - 24 - - - Top - - - Fill - - - True - - - Zoom - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - $this - - - 0, 16 - - - $this - - - chkShow - - - $this - - - txtUrl - - - 2 - - - picQRCode - - - 356, 70 - - - 25 - - - 6, 12 + + 356, 441 True - + + Top + + + 0, 0 + + + 356, 16 + + + 25 + + + Sharing panel + + + Fill + + + 0, 16 + + + 356, 355 + + + Zoom + + + 24 + + + Bottom + + + 0, 371 + + True - + + + 356, 70 + + + 0 + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/SubSettingControl.resx b/v2rayN/v2rayN/Forms/SubSettingControl.resx index af5f03e9..a5dec524 100644 --- a/v2rayN/v2rayN/Forms/SubSettingControl.resx +++ b/v2rayN/v2rayN/Forms/SubSettingControl.resx @@ -118,213 +118,123 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - NoControl - - - groupBox2 - - - 60, 16 - - - txtUrl - - - &Remove - - - 484, 21 - - - 24 - - - 432, 46 - - - SubSettingControl - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - groupBox2 - - - 83, 12 - - - groupBox2 - 6, 12 - - label3 + + zh-Hans - - 127, 21 - - + True - - 0 - - - 12, 55 - - - 127, 55 - - - 10 - - - Bottom - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - groupBox2 - - - 4 - - - 47, 12 - - - Subscription details - - - 0, 9 - - - Enable - - - chkEnabled - - - 3 - - - NoControl - - - Address (url) - - - 25 - - - 23 - - - groupBox2 - - - groupBox2 - - - 406, 23 - - - True - - - True - - - btnRemove - - - NoControl - - - label2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 584, 110 - - - NoControl - 584, 119 - - 11 + + NoControl - - Remarks - - - 0 - - - 12, 25 + + 484, 21 75, 23 - - groupBox2 + + 24 - - 265, 21 + + &Remove + + + True + + + NoControl + + + 406, 23 + + + 60, 16 + + + 25 + + + Enable + + + Bottom + + + 0, 9 + + + 584, 110 10 - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Subscription details - - 1 + + True - - $this + + NoControl - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 12, 25 - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 47, 12 - + + 10 + + + Remarks + + + True + + + NoControl + + + 12, 55 + + + 83, 12 + + 0 - - txtRemarks + + Address (url) - - 5 + + 127, 21 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 265, 21 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 11 - + + 127, 55 + + True - - - zh-Hans - + + + 432, 46 + + + 23 + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/SubSettingControl.zh-Hans.resx b/v2rayN/v2rayN/Forms/SubSettingControl.zh-Hans.resx index 12e6dbd4..95e5122f 100644 --- a/v2rayN/v2rayN/Forms/SubSettingControl.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/SubSettingControl.zh-Hans.resx @@ -118,14 +118,17 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 移除 + 48, 16 启用 - - 移除 + + 订阅详情 29, 12 @@ -139,7 +142,4 @@ 地址 (url) - - 订阅详情 - \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/SubSettingForm.cs b/v2rayN/v2rayN/Forms/SubSettingForm.cs index 25ac20e6..0cc90ae2 100644 --- a/v2rayN/v2rayN/Forms/SubSettingForm.cs +++ b/v2rayN/v2rayN/Forms/SubSettingForm.cs @@ -35,7 +35,7 @@ namespace v2rayN.Forms for (int k = config.subItem.Count - 1; k >= 0; k--) { - var item = config.subItem[k]; + SubItem item = config.subItem[k]; if (Utils.IsNullOrEmpty(item.remarks) && Utils.IsNullOrEmpty(item.url)) { @@ -47,7 +47,7 @@ namespace v2rayN.Forms } } - foreach (var item in config.subItem) + foreach (SubItem item in config.subItem) { SubSettingControl control = new SubSettingControl(); control.OnButtonClicked += Control_OnButtonClicked; @@ -98,10 +98,12 @@ namespace v2rayN.Forms private void AddSub() { - var subItem = new SubItem(); - subItem.id = string.Empty; - subItem.remarks = "remarks"; - subItem.url = "url"; + SubItem subItem = new SubItem + { + id = string.Empty, + remarks = "remarks", + url = "url" + }; config.subItem.Add(subItem); } } diff --git a/v2rayN/v2rayN/Forms/SubSettingForm.resx b/v2rayN/v2rayN/Forms/SubSettingForm.resx index 05d3db7b..e2001bb5 100644 --- a/v2rayN/v2rayN/Forms/SubSettingForm.resx +++ b/v2rayN/v2rayN/Forms/SubSettingForm.resx @@ -118,61 +118,19 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - NoControl - - - 448, 17 - - - 75, 23 - - - 4 + + 6, 12 - - &Cancel + + 581, 629 - - btnClose - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 1 - - + True - - Fill - - - 0, 0 - - - 581, 569 - - - 10 - - - panCon - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 + + Subscription settings NoControl @@ -189,17 +147,20 @@ &Add - - btnAdd + + NoControl - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 448, 17 - - panel2 + + 75, 23 - - 0 + + 4 + + + &Cancel NoControl @@ -216,17 +177,20 @@ &OK - - btnOK + + True - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Fill - - panel2 + + 0, 0 - - 2 + + 581, 569 + + + 10 Bottom @@ -240,34 +204,4 @@ 7 - - panel2 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - True - - - 6, 12 - - - 581, 629 - - - Subscription settings - - - SubSettingForm - - - 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/SubSettingForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/SubSettingForm.zh-Hans.resx index 628dd5ab..35c3cbac 100644 --- a/v2rayN/v2rayN/Forms/SubSettingForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/SubSettingForm.zh-Hans.resx @@ -117,12 +117,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 取消(&C) + + 订阅设置 添加(&A) + + 取消(&C) + 确定(&O) @@ -143,7 +146,4 @@ ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw== - - 订阅设置 - \ No newline at end of file diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index bd9d16df..d816617a 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -30,34 +30,38 @@ namespace v2rayN.Handler } if (config == null) { - config = new Config(); - config.index = -1; - config.logEnabled = false; - config.loglevel = "warning"; - config.vmess = new List(); + config = new Config + { + index = -1, + logEnabled = false, + loglevel = "warning", + vmess = new List(), - //Mux - config.muxEnabled = true; + //Mux + muxEnabled = true, - ////默认监听端口 - //config.pacPort = 8888; - - // 默认不开启统计 - config.enableStatistics = false; + ////默认监听端口 + //config.pacPort = 8888; - // 默认中等刷新率 - config.statisticsFreshRate = (int)Global.StatisticsFreshRate.medium; + // 默认不开启统计 + enableStatistics = false, + + // 默认中等刷新率 + statisticsFreshRate = (int)Global.StatisticsFreshRate.medium + }; } //本地监听 if (config.inbound == null) { config.inbound = new List(); - InItem inItem = new InItem(); - inItem.protocol = Global.InboundSocks; - inItem.localPort = 10808; - inItem.udpEnabled = true; - inItem.sniffingEnabled = true; + InItem inItem = new InItem + { + protocol = Global.InboundSocks, + localPort = 10808, + udpEnabled = true, + sniffingEnabled = true + }; config.inbound.Add(inItem); @@ -100,14 +104,16 @@ namespace v2rayN.Handler //kcp if (config.kcpItem == null) { - config.kcpItem = new KcpItem(); - config.kcpItem.mtu = 1350; - config.kcpItem.tti = 50; - config.kcpItem.uplinkCapacity = 12; - config.kcpItem.downlinkCapacity = 100; - config.kcpItem.readBufferSize = 2; - config.kcpItem.writeBufferSize = 2; - config.kcpItem.congestion = false; + config.kcpItem = new KcpItem + { + mtu = 1350, + tti = 50, + uplinkCapacity = 12, + downlinkCapacity = 100, + readBufferSize = 2, + writeBufferSize = 2, + congestion = false + }; } if (config.uiItem == null) { @@ -118,6 +124,14 @@ namespace v2rayN.Handler //{ // config.pacPort = 8888; //} + if (Utils.IsNullOrEmpty(config.speedTestUrl)) + { + config.speedTestUrl = Global.SpeedTestUrl; + } + if (Utils.IsNullOrEmpty(config.speedPingTestUrl)) + { + config.speedPingTestUrl = Global.SpeedPingTestUrl; + } if (Utils.IsNullOrEmpty(config.urlGFWList)) { config.urlGFWList = Global.GFWLIST_URL; @@ -259,20 +273,22 @@ namespace v2rayN.Handler return -1; } - VmessItem vmessItem = new VmessItem(); - vmessItem.configVersion = config.vmess[index].configVersion; - vmessItem.configType = config.vmess[index].configType; - vmessItem.address = config.vmess[index].address; - vmessItem.port = config.vmess[index].port; - vmessItem.id = config.vmess[index].id; - vmessItem.alterId = config.vmess[index].alterId; - vmessItem.security = config.vmess[index].security; - vmessItem.network = config.vmess[index].network; - vmessItem.headerType = config.vmess[index].headerType; - vmessItem.requestHost = config.vmess[index].requestHost; - vmessItem.path = config.vmess[index].path; - vmessItem.streamSecurity = config.vmess[index].streamSecurity; - vmessItem.remarks = string.Format("{0}-clone", config.vmess[index].remarks); + VmessItem vmessItem = new VmessItem + { + configVersion = config.vmess[index].configVersion, + configType = config.vmess[index].configType, + address = config.vmess[index].address, + port = config.vmess[index].port, + id = config.vmess[index].id, + alterId = config.vmess[index].alterId, + security = config.vmess[index].security, + network = config.vmess[index].network, + headerType = config.vmess[index].headerType, + requestHost = config.vmess[index].requestHost, + path = config.vmess[index].path, + streamSecurity = config.vmess[index].streamSecurity, + remarks = string.Format("{0}-clone", config.vmess[index].remarks) + }; config.vmess.Insert(index + 1, vmessItem); // 插入到下一项 @@ -345,18 +361,20 @@ namespace v2rayN.Handler VmessItem vmessItem = config.vmess[index]; if (vmessItem.configType == (int)EConfigType.Vmess) { - VmessQRCode vmessQRCode = new VmessQRCode(); - vmessQRCode.v = vmessItem.configVersion.ToString(); - vmessQRCode.ps = vmessItem.remarks.TrimEx(); //备注也许很长 ; - vmessQRCode.add = vmessItem.address; - vmessQRCode.port = vmessItem.port.ToString(); - vmessQRCode.id = vmessItem.id; - vmessQRCode.aid = vmessItem.alterId.ToString(); - vmessQRCode.net = vmessItem.network; - vmessQRCode.type = vmessItem.headerType; - vmessQRCode.host = vmessItem.requestHost; - vmessQRCode.path = vmessItem.path; - vmessQRCode.tls = vmessItem.streamSecurity; + VmessQRCode vmessQRCode = new VmessQRCode + { + v = vmessItem.configVersion.ToString(), + ps = vmessItem.remarks.TrimEx(), //备注也许很长 ; + add = vmessItem.address, + port = vmessItem.port.ToString(), + id = vmessItem.id, + aid = vmessItem.alterId.ToString(), + net = vmessItem.network, + type = vmessItem.headerType, + host = vmessItem.requestHost, + path = vmessItem.path, + tls = vmessItem.streamSecurity + }; url = Utils.ToJson(vmessQRCode); url = Utils.Base64Encode(url); @@ -365,7 +383,7 @@ namespace v2rayN.Handler } else if (vmessItem.configType == (int)EConfigType.Shadowsocks) { - var remark = string.Empty; + string remark = string.Empty; if (!Utils.IsNullOrEmpty(vmessItem.remarks)) { remark = "#" + WebUtility.UrlEncode(vmessItem.remarks); @@ -380,7 +398,7 @@ namespace v2rayN.Handler } else if (vmessItem.configType == (int)EConfigType.Socks) { - var remark = string.Empty; + string remark = string.Empty; if (!Utils.IsNullOrEmpty(vmessItem.remarks)) { remark = "#" + WebUtility.UrlEncode(vmessItem.remarks); @@ -426,7 +444,7 @@ namespace v2rayN.Handler { return 0; } - VmessItem vmess = Utils.DeepCopy(config.vmess[index]); + VmessItem vmess = Utils.DeepCopy(config.vmess[index]); config.vmess.RemoveAt(index); config.vmess.Insert(0, vmess); if (index < config.index) @@ -449,7 +467,7 @@ namespace v2rayN.Handler { return 0; } - VmessItem vmess = Utils.DeepCopy(config.vmess[index]); + VmessItem vmess = Utils.DeepCopy(config.vmess[index]); config.vmess.RemoveAt(index); config.vmess.Insert(index - 1, vmess); if (index == config.index + 1) @@ -469,7 +487,7 @@ namespace v2rayN.Handler { return 0; } - VmessItem vmess = Utils.DeepCopy(config.vmess[index]); + VmessItem vmess = Utils.DeepCopy(config.vmess[index]); config.vmess.RemoveAt(index); config.vmess.Insert(index + 1, vmess); if (index == config.index - 1) @@ -488,7 +506,7 @@ namespace v2rayN.Handler { return 0; } - VmessItem vmess = Utils.DeepCopy(config.vmess[index]); + VmessItem vmess = Utils.DeepCopy(config.vmess[index]); config.vmess.RemoveAt(index); config.vmess.Add(vmess); if (index < config.index) @@ -535,10 +553,12 @@ namespace v2rayN.Handler return -1; } - VmessItem vmessItem = new VmessItem(); - vmessItem.address = newFileName; - vmessItem.configType = (int)EConfigType.Custom; - vmessItem.remarks = string.Format("import custom@{0}", DateTime.Now.ToShortDateString()); + VmessItem vmessItem = new VmessItem + { + address = newFileName, + configType = (int)EConfigType.Custom, + remarks = string.Format("import custom@{0}", DateTime.Now.ToShortDateString()) + }; config.vmess.Add(vmessItem); if (config.vmess.Count == 1) @@ -741,7 +761,6 @@ namespace v2rayN.Handler string[] arrData = clipboardData.Split(Environment.NewLine.ToCharArray()); foreach (string str in arrData) { - string msg; //maybe sub if (str.StartsWith(Global.httpsProtocol) || str.StartsWith(Global.httpProtocol)) { @@ -751,7 +770,7 @@ namespace v2rayN.Handler } continue; } - VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(str, out msg); + VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(str, out string msg); if (vmessItem == null) { continue; @@ -791,7 +810,7 @@ namespace v2rayN.Handler public static int AddSubItem(ref Config config, string url) { //already exists - foreach (var sub in config.subItem) + foreach (SubItem sub in config.subItem) { if (url == sub.url) { @@ -799,10 +818,12 @@ namespace v2rayN.Handler } } - var subItem = new SubItem(); - subItem.id = string.Empty; - subItem.remarks = "import sub"; - subItem.url = url; + SubItem subItem = new SubItem + { + id = string.Empty, + remarks = "import sub", + url = url + }; config.subItem.Add(subItem); return SaveSubItem(ref config); diff --git a/v2rayN/v2rayN/Handler/DownloadHandle.cs b/v2rayN/v2rayN/Handler/DownloadHandle.cs index 15aaf93b..2c76da01 100644 --- a/v2rayN/v2rayN/Handler/DownloadHandle.cs +++ b/v2rayN/v2rayN/Handler/DownloadHandle.cs @@ -60,8 +60,10 @@ namespace v2rayN.Handler public async Task CheckUpdateAsync(string type) { Utils.SetSecurityProtocol(); - WebRequestHandler webRequestHandler = new WebRequestHandler(); - webRequestHandler.AllowAutoRedirect = false; + WebRequestHandler webRequestHandler = new WebRequestHandler + { + AllowAutoRedirect = false + }; HttpClient httpClient = new HttpClient(webRequestHandler); string url; @@ -337,9 +339,9 @@ namespace v2rayN.Handler byte[] bytes = Convert.FromBase64String(response); string content = Encoding.UTF8.GetString(bytes); List valid_lines = new List(); - using (var sr = new StringReader(content)) + using (StringReader sr = new StringReader(content)) { - foreach (var line in sr.NonWhiteSpaceLines()) + foreach (string line in sr.NonWhiteSpaceLines()) { if (line.BeginWithAny(IgnoredLineBegins)) continue; diff --git a/v2rayN/v2rayN/Handler/MainFormHandler.cs b/v2rayN/v2rayN/Handler/MainFormHandler.cs index 26b7afb0..e39623d3 100644 --- a/v2rayN/v2rayN/Handler/MainFormHandler.cs +++ b/v2rayN/v2rayN/Handler/MainFormHandler.cs @@ -1,13 +1,6 @@ -using Grpc.Core; -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System; using System.Drawing; -using System.Net; -using System.Net.Sockets; -using System.Threading; using System.Windows.Forms; -using v2rayN.Base; using v2rayN.Mode; namespace v2rayN.Handler @@ -38,23 +31,23 @@ namespace v2rayN.Handler { try { - var color = ColorTranslator.FromHtml("#3399CC"); - var index = config.listenerType; + Color color = ColorTranslator.FromHtml("#3399CC"); + int index = config.listenerType; if (index > 0) { 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]); } - var width = 128; - var height = 128; + int width = 128; + int height = 128; - var bitmap = new Bitmap(width, height); - var graphics = Graphics.FromImage(bitmap); - var drawBrush = new SolidBrush(color); + Bitmap bitmap = new Bitmap(width, height); + Graphics graphics = Graphics.FromImage(bitmap); + SolidBrush drawBrush = new SolidBrush(color); graphics.FillEllipse(drawBrush, new Rectangle(0, 0, width, height)); - var zoom = 16; + int zoom = 16; graphics.DrawImage(new Bitmap(Properties.Resources.notify, width - zoom, width - zoom), zoom / 2, zoom / 2); Icon createdIcon = Icon.FromHandle(bitmap.GetHicon()); @@ -85,10 +78,12 @@ namespace v2rayN.Handler return; } - SaveFileDialog fileDialog = new SaveFileDialog(); - fileDialog.Filter = "Config|*.json"; - fileDialog.FilterIndex = 2; - fileDialog.RestoreDirectory = true; + SaveFileDialog fileDialog = new SaveFileDialog + { + Filter = "Config|*.json", + FilterIndex = 2, + RestoreDirectory = true + }; if (fileDialog.ShowDialog() != DialogResult.OK) { return; @@ -98,10 +93,9 @@ namespace v2rayN.Handler { return; } - Config configCopy = Utils.DeepCopy(config); + Config configCopy = Utils.DeepCopy(config); configCopy.index = index; - string msg; - if (V2rayConfigHandler.Export2ClientConfig(configCopy, fileName, out msg) != 0) + if (V2rayConfigHandler.Export2ClientConfig(configCopy, fileName, out string msg) != 0) { UI.Show(msg); } @@ -124,10 +118,12 @@ namespace v2rayN.Handler return; } - SaveFileDialog fileDialog = new SaveFileDialog(); - fileDialog.Filter = "Config|*.json"; - fileDialog.FilterIndex = 2; - fileDialog.RestoreDirectory = true; + SaveFileDialog fileDialog = new SaveFileDialog + { + Filter = "Config|*.json", + FilterIndex = 2, + RestoreDirectory = true + }; if (fileDialog.ShowDialog() != DialogResult.OK) { return; @@ -137,10 +133,9 @@ namespace v2rayN.Handler { return; } - Config configCopy = Utils.DeepCopy(config); + Config configCopy = Utils.DeepCopy(config); configCopy.index = index; - string msg; - if (V2rayConfigHandler.Export2ServerConfig(configCopy, fileName, out msg) != 0) + if (V2rayConfigHandler.Export2ServerConfig(configCopy, fileName, out string msg) != 0) { UI.Show(msg); } diff --git a/v2rayN/v2rayN/Handler/QRCodeHelper.cs b/v2rayN/v2rayN/Handler/QRCodeHelper.cs index e5433dec..2fc56954 100644 --- a/v2rayN/v2rayN/Handler/QRCodeHelper.cs +++ b/v2rayN/v2rayN/Handler/QRCodeHelper.cs @@ -1,6 +1,4 @@ using System.Drawing; -using System.Drawing.Imaging; -using System.IO; using ZXing; using ZXing.QrCode; @@ -16,18 +14,22 @@ namespace v2rayN.Handler Image img = null; try { - QrCodeEncodingOptions options = new QrCodeEncodingOptions(); - options.CharacterSet = "UTF-8"; - options.DisableECI = true; // Extended Channel Interpretation (ECI) 主要用于特殊的字符集。并不是所有的扫描器都支持这种编码。 - options.ErrorCorrection = ZXing.QrCode.Internal.ErrorCorrectionLevel.M; // 纠错级别 - options.Width = 500; - options.Height = 500; - options.Margin = 1; + QrCodeEncodingOptions options = new QrCodeEncodingOptions + { + CharacterSet = "UTF-8", + DisableECI = true, // Extended Channel Interpretation (ECI) 主要用于特殊的字符集。并不是所有的扫描器都支持这种编码。 + ErrorCorrection = ZXing.QrCode.Internal.ErrorCorrectionLevel.M, // 纠错级别 + Width = 500, + Height = 500, + Margin = 1 + }; // options.Hints,更多属性,也可以在这里添加。 - BarcodeWriter writer = new BarcodeWriter(); - writer.Format = BarcodeFormat.QR_CODE; - writer.Options = options; + BarcodeWriter writer = new BarcodeWriter + { + Format = BarcodeFormat.QR_CODE, + Options = options + }; Bitmap bmp = writer.Write(strContent); img = (Image)bmp; return img; diff --git a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs index 69bc5a9c..cbfc165a 100644 --- a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs +++ b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Net; using System.Net.Sockets; using System.Threading; +using System.Threading.Tasks; using v2rayN.Mode; namespace v2rayN.Handler @@ -14,7 +15,6 @@ namespace v2rayN.Handler private Config _config; private V2rayHandler _v2rayHandler; private List _selecteds; - private Thread _workThread; Action _updateFunc; private int testCounter = 0; @@ -35,40 +35,23 @@ namespace v2rayN.Handler if (actionType == "ping") { - _workThread = new Thread(new ThreadStart(RunPing)); - _workThread.IsBackground = true; - _workThread.Start(); + Task.Run(() => RunPing()); } if (actionType == "tcping") { - _workThread = new Thread(new ThreadStart(RunTcping)); - _workThread.IsBackground = true; - _workThread.Start(); + Task.Run(() => RunTcping()); } else if (actionType == "realping") { - _workThread = new Thread(new ThreadStart(RunRealPing)); - _workThread.IsBackground = true; - _workThread.Start(); + Task.Run(() => RunRealPing()); } else if (actionType == "speedtest") { - RunSpeedTest(); + Task.Run(() => RunSpeedTest()); } } - public void Close() - { - try - { - } - catch (Exception ex) - { - Utils.SaveLog(ex.Message, ex); - } - } - - private void RunPing() + private void RunPingSub(Action updateFun) { try { @@ -80,38 +63,7 @@ namespace v2rayN.Handler } try { - long time = Utils.Ping(_config.vmess[index].address); - _updateFunc(index, string.Format("{0}ms", time)); - } - catch (Exception ex) - { - Utils.SaveLog(ex.Message, ex); - } - } - - Thread.Sleep(100); - - } - catch (Exception ex) - { - Utils.SaveLog(ex.Message, ex); - } - } - - private void RunTcping() - { - try - { - foreach (int index in _selecteds) - { - if (_config.vmess[index].configType == (int)EConfigType.Custom) - { - continue; - } - try - { - var time = GetTcpingTime(_config.vmess[index].address, _config.vmess[index].port); - _updateFunc(index, string.Format("{0}ms", time)); + updateFun(index); } catch (Exception ex) { @@ -120,7 +72,6 @@ namespace v2rayN.Handler } Thread.Sleep(10); - } catch (Exception ex) { @@ -128,6 +79,25 @@ namespace v2rayN.Handler } } + + private void RunPing() + { + RunPingSub((int index) => + { + long time = Utils.Ping(_config.vmess[index].address); + _updateFunc(index, string.Format("{0}ms", time)); + }); + } + + private void RunTcping() + { + RunPingSub((int index) => + { + int time = GetTcpingTime(_config.vmess[index].address, _config.vmess[index].port); + _updateFunc(index, string.Format("{0}ms", time)); + }); + } + private void RunRealPing() { try @@ -138,40 +108,38 @@ namespace v2rayN.Handler _v2rayHandler.LoadV2ray(_config, _selecteds); Thread.Sleep(5000); - - var httpPort = _config.GetLocalPort("speedtest"); - foreach (int index in _selecteds) + int httpPort = _config.GetLocalPort("speedtest"); + Task[] tasks = new Task[_selecteds.Count]; + int i = -1; + foreach (int itemIndex in _selecteds) { - if (_config.vmess[index].configType == (int)EConfigType.Custom) + if (_config.vmess[itemIndex].configType == (int)EConfigType.Custom) { continue; } - try - { - var webProxy = new WebProxy(Global.Loopback, httpPort + index); - int responseTime = -1; - var status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out responseTime); - if (!Utils.IsNullOrEmpty(status)) + i++; + tasks[i] = Task.Run(() => { + try { - _updateFunc(index, string.Format("{0}", status)); + WebProxy webProxy = new WebProxy(Global.Loopback, httpPort + itemIndex); + int responseTime = -1; + string status = GetRealPingTime(_config.speedPingTestUrl, webProxy, out responseTime); + string output = Utils.IsNullOrEmpty(status) ? string.Format("{0}ms", responseTime) : string.Format("{0}", status); + _updateFunc(itemIndex, output); } - else + catch (Exception ex) { - _updateFunc(index, string.Format("{0}ms", responseTime)); + Utils.SaveLog(ex.Message, ex); } - } - catch (Exception ex) - { - Utils.SaveLog(ex.Message, ex); - } - Thread.Sleep(100); + }); + //Thread.Sleep(100); } + Task.WaitAll(tasks); Global.reloadV2ray = true; _v2rayHandler.LoadV2ray(_config); Thread.Sleep(100); - } catch (Exception ex) { @@ -192,7 +160,7 @@ namespace v2rayN.Handler Thread.Sleep(5000); - string url = Global.SpeedTestUrl; + string url = _config.speedTestUrl; testCounter = 0; if (downloadHandle2 == null) { @@ -237,11 +205,11 @@ namespace v2rayN.Handler return -1; } - var httpPort = _config.GetLocalPort("speedtest"); + int httpPort = _config.GetLocalPort("speedtest"); index = _selecteds[index]; testCounter++; - var webProxy = new WebProxy(Global.Loopback, httpPort + index); + WebProxy webProxy = new WebProxy(Global.Loopback, httpPort + index); downloadHandle2.DownloadFileAsync(_config, url, webProxy, 20); return 0; @@ -249,21 +217,20 @@ namespace v2rayN.Handler private int GetTcpingTime(string url, int port) { - var responseTime = -1; + int responseTime = -1; try { - IPAddress ipAddress; - if (!System.Net.IPAddress.TryParse(url, out ipAddress)) + if (!IPAddress.TryParse(url, out IPAddress ipAddress)) { IPHostEntry ipHostInfo = System.Net.Dns.GetHostEntry(url); ipAddress = ipHostInfo.AddressList[0]; } - var timer = new Stopwatch(); + Stopwatch timer = new Stopwatch(); timer.Start(); - var endPoint = new IPEndPoint(ipAddress, port); + IPEndPoint endPoint = new IPEndPoint(ipAddress, port); Socket clientSocket = new Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp); IAsyncResult result = clientSocket.BeginConnect(endPoint, null, null); @@ -286,14 +253,13 @@ namespace v2rayN.Handler { string msg = string.Empty; responseTime = -1; - try { HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url); myHttpWebRequest.Timeout = 5000; myHttpWebRequest.Proxy = webProxy;//new WebProxy(Global.Loopback, Global.httpPort); - var timer = new Stopwatch(); + Stopwatch timer = new Stopwatch(); timer.Start(); HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); @@ -313,7 +279,6 @@ namespace v2rayN.Handler msg = ex.Message; } return msg; - } } } diff --git a/v2rayN/v2rayN/Handler/StatisticsHandler.cs b/v2rayN/v2rayN/Handler/StatisticsHandler.cs index 8d5a3a24..ab4d4a6a 100644 --- a/v2rayN/v2rayN/Handler/StatisticsHandler.cs +++ b/v2rayN/v2rayN/Handler/StatisticsHandler.cs @@ -1,14 +1,12 @@ using Grpc.Core; using System; using System.Collections.Generic; -using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; +using System.Threading.Tasks; using v2rayN.Mode; -using v2rayN.Properties; using v2rayN.Protos.Statistics; -using v2rayN.Tool; namespace v2rayN.Handler { @@ -18,7 +16,6 @@ namespace v2rayN.Handler private ServerStatistics serverStatistics_; private Channel channel_; private StatsService.StatsServiceClient client_; - private Thread workThread_; private bool exitFlag_; Action> updateFunc_; @@ -70,9 +67,7 @@ namespace v2rayN.Handler GrpcInit(); - workThread_ = new Thread(new ThreadStart(Run)); - workThread_.IsBackground = true; - workThread_.Start(); + Task.Run(() => Run()); } private void GrpcInit() @@ -120,13 +115,11 @@ namespace v2rayN.Handler if (res != null) { - var itemId = config_.getItemId(); - var serverStatItem = GetServerStatItem(itemId); - ulong up = 0, - down = 0; + string itemId = config_.getItemId(); + ServerStatItem serverStatItem = GetServerStatItem(itemId); //TODO: parse output - ParseOutput(res.Stat, out up, out down); + ParseOutput(res.Stat, out ulong up, out ulong down); serverStatItem.todayUp += up; serverStatItem.todayDown += down; @@ -169,8 +162,8 @@ namespace v2rayN.Handler serverStatistics_.server = new List(); } - var ticks = DateTime.Now.Date.Ticks; - foreach (var item in serverStatistics_.server) + long ticks = DateTime.Now.Date.Ticks; + foreach (ServerStatItem item in serverStatistics_.server) { if (item.dateNow != ticks) { @@ -200,8 +193,8 @@ namespace v2rayN.Handler private ServerStatItem GetServerStatItem(string itemId) { - var ticks = DateTime.Now.Date.Ticks; - var cur = Statistic.FindIndex(item => item.itemId == itemId); + long ticks = DateTime.Now.Date.Ticks; + int cur = Statistic.FindIndex(item => item.itemId == itemId); if (cur < 0) { Statistic.Add(new ServerStatItem @@ -231,12 +224,12 @@ namespace v2rayN.Handler try { - foreach (var stat in source) + foreach (Stat stat in source) { - var name = stat.Name; - var value = stat.Value; - var nStr = name.Split(">>>".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); - var type = ""; + string name = stat.Name; + long value = stat.Value; + string[] nStr = name.Split(">>>".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); + string type = ""; name = name.Trim(); @@ -270,7 +263,7 @@ namespace v2rayN.Handler // TCP stack please do me a favor TcpListener l = new TcpListener(IPAddress.Loopback, 0); l.Start(); - var port = ((IPEndPoint)l.LocalEndpoint).Port; + int port = ((IPEndPoint)l.LocalEndpoint).Port; l.Stop(); return port; } diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index dc34ee2c..b4b629fc 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -149,7 +149,7 @@ namespace v2rayN.Handler { try { - var inbound = v2rayConfig.inbounds[0]; + Inbounds inbound = v2rayConfig.inbounds[0]; //端口 inbound.port = config.inbound[0].localPort; inbound.protocol = config.inbound[0].protocol; @@ -226,16 +226,20 @@ namespace v2rayN.Handler && userRule.Count > 0) { //Domain - RulesItem rulesDomain = new RulesItem(); - rulesDomain.type = "field"; - rulesDomain.outboundTag = tag; - rulesDomain.domain = new List(); + RulesItem rulesDomain = new RulesItem + { + type = "field", + outboundTag = tag, + domain = new List() + }; //IP - RulesItem rulesIP = new RulesItem(); - rulesIP.type = "field"; - rulesIP.outboundTag = tag; - rulesIP.ip = new List(); + RulesItem rulesIP = new RulesItem + { + type = "field", + outboundTag = tag, + ip = new List() + }; foreach (string u in userRule) { @@ -283,10 +287,12 @@ namespace v2rayN.Handler //IP if (ipOrDomain == "ip" || ipOrDomain == "") { - RulesItem rulesItem = new RulesItem(); - rulesItem.type = "field"; - rulesItem.outboundTag = Global.directTag; - rulesItem.ip = new List(); + RulesItem rulesItem = new RulesItem + { + type = "field", + outboundTag = Global.directTag, + ip = new List() + }; rulesItem.ip.Add($"geoip:{code}"); v2rayConfig.routing.rules.Add(rulesItem); @@ -294,10 +300,12 @@ namespace v2rayN.Handler if (ipOrDomain == "domain" || ipOrDomain == "") { - RulesItem rulesItem = new RulesItem(); - rulesItem.type = "field"; - rulesItem.outboundTag = Global.directTag; - rulesItem.domain = new List(); + RulesItem rulesItem = new RulesItem + { + type = "field", + outboundTag = Global.directTag, + domain = new List() + }; rulesItem.domain.Add($"geosite:{code}"); v2rayConfig.routing.rules.Add(rulesItem); } @@ -319,7 +327,7 @@ namespace v2rayN.Handler { try { - var outbound = v2rayConfig.outbounds[0]; + Outbounds outbound = v2rayConfig.outbounds[0]; if (config.configType() == (int)EConfigType.Vmess) { VnextItem vnextItem; @@ -412,10 +420,12 @@ namespace v2rayN.Handler if (!Utils.IsNullOrEmpty(config.security()) && !Utils.IsNullOrEmpty(config.id())) { - var socksUsersItem = new SocksUsersItem(); - socksUsersItem.user = config.security(); - socksUsersItem.pass = config.id(); - socksUsersItem.level = 1; + SocksUsersItem socksUsersItem = new SocksUsersItem + { + user = config.security(), + pass = config.id(), + level = 1 + }; serversItem.users = new List() { socksUsersItem }; } @@ -446,14 +456,16 @@ namespace v2rayN.Handler { //远程服务器底层传输配置 streamSettings.network = config.network(); - var host = config.requestHost(); + string host = config.requestHost(); //if tls if (config.streamSecurity() == Global.StreamSecurity) { streamSettings.security = config.streamSecurity(); - TlsSettings tlsSettings = new TlsSettings(); - tlsSettings.allowInsecure = config.allowInsecure(); + TlsSettings tlsSettings = new TlsSettings + { + allowInsecure = config.allowInsecure() + }; if (!string.IsNullOrWhiteSpace(host)) { tlsSettings.serverName = host; @@ -466,9 +478,11 @@ namespace v2rayN.Handler { //kcp基本配置暂时是默认值,用户能自己设置伪装类型 case "kcp": - KcpSettings kcpSettings = new KcpSettings(); - kcpSettings.mtu = config.kcpItem.mtu; - kcpSettings.tti = config.kcpItem.tti; + KcpSettings kcpSettings = new KcpSettings + { + mtu = config.kcpItem.mtu, + tti = config.kcpItem.tti + }; if (iobound.Equals("out")) { kcpSettings.uplinkCapacity = config.kcpItem.uplinkCapacity; @@ -488,20 +502,26 @@ namespace v2rayN.Handler kcpSettings.congestion = config.kcpItem.congestion; kcpSettings.readBufferSize = config.kcpItem.readBufferSize; kcpSettings.writeBufferSize = config.kcpItem.writeBufferSize; - kcpSettings.header = new Header(); - kcpSettings.header.type = config.headerType(); + kcpSettings.header = new Header + { + type = config.headerType() + }; streamSettings.kcpSettings = kcpSettings; break; //ws case "ws": - WsSettings wsSettings = new WsSettings(); - wsSettings.connectionReuse = true; + WsSettings wsSettings = new WsSettings + { + connectionReuse = true + }; string path = config.path(); if (!string.IsNullOrWhiteSpace(host)) { - wsSettings.headers = new Headers(); - wsSettings.headers.Host = host; + wsSettings.headers = new Headers + { + Host = host + }; } if (!string.IsNullOrWhiteSpace(path)) { @@ -535,11 +555,15 @@ namespace v2rayN.Handler break; //quic case "quic": - QuicSettings quicsettings = new QuicSettings(); - quicsettings.security = host; - quicsettings.key = config.path(); - quicsettings.header = new Header(); - quicsettings.header.type = config.headerType(); + QuicSettings quicsettings = new QuicSettings + { + security = host, + key = config.path(), + header = new Header + { + type = config.headerType() + } + }; streamSettings.quicSettings = quicsettings; if (config.streamSecurity() == Global.StreamSecurity) { @@ -550,10 +574,14 @@ namespace v2rayN.Handler //tcp带http伪装 if (config.headerType().Equals(Global.TcpHeaderHttp)) { - TcpSettings tcpSettings = new TcpSettings(); - tcpSettings.connectionReuse = true; - tcpSettings.header = new Header(); - tcpSettings.header.type = config.headerType(); + TcpSettings tcpSettings = new TcpSettings + { + connectionReuse = true, + header = new Header + { + type = config.headerType() + } + }; if (iobound.Equals("out")) { @@ -616,8 +644,10 @@ namespace v2rayN.Handler //} } //servers.Add("localhost"); - v2rayConfig.dns = new Mode.Dns(); - v2rayConfig.dns.servers = servers; + v2rayConfig.dns = new Mode.Dns + { + servers = servers + }; } catch { @@ -629,10 +659,10 @@ namespace v2rayN.Handler { if (config.enableStatistics) { - var tag = Global.InboundAPITagName; - var apiObj = new Mode.API(); - var policyObj = new Mode.Policy(); - var policySystemSetting = new Mode.SystemPolicy(); + string tag = Global.InboundAPITagName; + API apiObj = new API(); + Policy policyObj = new Policy(); + SystemPolicy policySystemSetting = new SystemPolicy(); string[] services = { "StatsService" }; @@ -649,8 +679,8 @@ namespace v2rayN.Handler if (!v2rayConfig.inbounds.Exists(item => { return item.tag == tag; })) { - var apiInbound = new Mode.Inbounds(); - var apiInboundSettings = new Mode.Inboundsettings(); + Inbounds apiInbound = new Inbounds(); + Inboundsettings apiInboundSettings = new Inboundsettings(); apiInbound.tag = tag; apiInbound.listen = Global.Loopback; apiInbound.port = Global.statePort; @@ -662,10 +692,12 @@ namespace v2rayN.Handler if (!v2rayConfig.routing.rules.Exists(item => { return item.outboundTag == tag; })) { - var apiRoutingRule = new Mode.RulesItem(); - apiRoutingRule.inboundTag = new List { tag }; - apiRoutingRule.outboundTag = tag; - apiRoutingRule.type = "field"; + RulesItem apiRoutingRule = new RulesItem + { + inboundTag = new List { tag }, + outboundTag = tag, + type = "field" + }; v2rayConfig.routing.rules.Add(apiRoutingRule); } } @@ -800,7 +832,7 @@ namespace v2rayN.Handler { try { - var inbound = v2rayConfig.inbounds[0]; + Inbounds inbound = v2rayConfig.inbounds[0]; UsersItem usersItem; if (inbound.settings.clients.Count <= 0) { @@ -889,7 +921,7 @@ namespace v2rayN.Handler return null; } - var outbound = v2rayConfig.outbounds[0]; + Outbounds outbound = v2rayConfig.outbounds[0]; if (outbound == null || Utils.IsNullOrEmpty(outbound.protocol) || outbound.protocol != "vmess" @@ -1035,7 +1067,7 @@ namespace v2rayN.Handler return null; } - var inbound = v2rayConfig.inbounds[0]; + Inbounds inbound = v2rayConfig.inbounds[0]; if (inbound == null || Utils.IsNullOrEmpty(inbound.protocol) || inbound.protocol != "vmess" @@ -1345,9 +1377,10 @@ namespace v2rayN.Handler private static VmessItem ResolveVmess4Kitsunebi(string result) { - VmessItem vmessItem = new VmessItem(); - - vmessItem.configType = (int)EConfigType.Vmess; + VmessItem vmessItem = new VmessItem + { + configType = (int)EConfigType.Vmess + }; result = result.Substring(Global.vmessProtocol.Length); int indexSplit = result.IndexOf("?"); if (indexSplit > 0) @@ -1404,7 +1437,7 @@ namespace v2rayN.Handler msg = UIRes.I18N("InitialConfiguration"); - Config configCopy = Utils.DeepCopy(config); + Config configCopy = Utils.DeepCopy(config); string result = Utils.GetEmbedText(SampleClient); if (Utils.IsNullOrEmpty(result)) @@ -1425,7 +1458,7 @@ namespace v2rayN.Handler dns(configCopy, ref v2rayConfig); - var httpPort = configCopy.GetLocalPort("speedtest"); + int httpPort = configCopy.GetLocalPort("speedtest"); foreach (int index in selecteds) { if (configCopy.vmess[index].configType == (int)EConfigType.Custom) @@ -1435,23 +1468,27 @@ namespace v2rayN.Handler configCopy.index = index; - var inbound = new Inbounds(); - inbound.listen = Global.Loopback; - inbound.port = httpPort + index; - inbound.protocol = Global.InboundHttp; + Inbounds inbound = new Inbounds + { + listen = Global.Loopback, + port = httpPort + index, + protocol = Global.InboundHttp + }; inbound.tag = Global.InboundHttp + inbound.port.ToString(); v2rayConfig.inbounds.Add(inbound); - var v2rayConfigCopy = Utils.FromJson(result); + V2rayConfig v2rayConfigCopy = Utils.FromJson(result); outbound(configCopy, ref v2rayConfigCopy); v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString(); v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]); - var rule = new Mode.RulesItem(); - rule.inboundTag = new List { inbound.tag }; - rule.outboundTag = v2rayConfigCopy.outbounds[0].tag; - rule.type = "field"; + RulesItem rule = new RulesItem + { + inboundTag = new List { inbound.tag }, + outboundTag = v2rayConfigCopy.outbounds[0].tag, + type = "field" + }; v2rayConfig.routing.rules.Add(rule); } @@ -1459,7 +1496,7 @@ namespace v2rayN.Handler msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), configCopy.getSummary()); } - catch (Exception ex) + catch { msg = UIRes.I18N("FailedGenDefaultConfiguration"); return -1; diff --git a/v2rayN/v2rayN/Handler/V2rayHandler.cs b/v2rayN/v2rayN/Handler/V2rayHandler.cs index 61d59bf6..5eeb411a 100644 --- a/v2rayN/v2rayN/Handler/V2rayHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayHandler.cs @@ -104,7 +104,7 @@ namespace v2rayN.Handler Process[] existing = Process.GetProcessesByName(vName); foreach (Process p in existing) { - var path = p.MainModule.FileName; + string path = p.MainModule.FileName; if (path == $"{Utils.GetPath(vName)}.exe") { KillProcess(p); diff --git a/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs b/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs index 897b4f03..4e0a0e29 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs @@ -23,7 +23,7 @@ namespace v2rayN.HttpProxyHandler { if (type != 0) { - var port = Global.httpPort; + int port = Global.httpPort; if (port <= 0) { return false; diff --git a/v2rayN/v2rayN/HttpProxyHandler/PACServerHandle.cs b/v2rayN/v2rayN/HttpProxyHandler/PACServerHandle.cs index 7b47fc4f..16f4cfef 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/PACServerHandle.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/PACServerHandle.cs @@ -114,7 +114,7 @@ namespace v2rayN.HttpProxyHandler { try { - var pac = GetPacList(address); + string pac = GetPacList(address); return pac; } catch (Exception ex) @@ -165,7 +165,7 @@ namespace v2rayN.HttpProxyHandler private static string GetPacList(string address) { - var port = Global.httpPort; + int port = Global.httpPort; if (port <= 0) { return "No port"; @@ -174,22 +174,22 @@ namespace v2rayN.HttpProxyHandler { List lstProxy = new List(); lstProxy.Add(string.Format("PROXY {0}:{1};", address, port)); - var proxy = string.Join("", lstProxy.ToArray()); + string proxy = string.Join("", lstProxy.ToArray()); string strPacfile = Utils.GetPath(Global.pacFILE); if (!File.Exists(strPacfile)) { FileManager.UncompressFile(strPacfile, Resources.pac_txt); } - var pac = File.ReadAllText(strPacfile, Encoding.UTF8); + string pac = File.ReadAllText(strPacfile, Encoding.UTF8); pac = pac.Replace("__PROXY__", proxy); if (_config.userPacRule.Count > 0) { - var keyWords = "var rules = ["; + string keyWords = "var rules = ["; if (pac.IndexOf(keyWords) >= 0) { - var userPac = string.Join($"\",{Environment.NewLine}\"", _config.userPacRule.ToArray()); + string userPac = string.Join($"\",{Environment.NewLine}\"", _config.userPacRule.ToArray()); userPac = string.Format("\"{0}\",", userPac); pac = pac.Replace(keyWords, keyWords + userPac); } diff --git a/v2rayN/v2rayN/HttpProxyHandler/PrivoxyHandler.cs b/v2rayN/v2rayN/HttpProxyHandler/PrivoxyHandler.cs index 773bad53..f738a318 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/PrivoxyHandler.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/PrivoxyHandler.cs @@ -172,7 +172,7 @@ namespace v2rayN.HttpProxyHandler /* * Under PortableMode, we could identify it by the path of v2ray_privoxy.exe. */ - var path = process.MainModule.FileName; + string path = process.MainModule.FileName; return Utils.GetTempPath($"{_privoxyName}.exe").Equals(path); diff --git a/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs b/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs index 254bf115..2ee71072 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs @@ -128,7 +128,7 @@ namespace v2rayN.HttpProxyHandler public InternetConnectionOptionValue m_Value; static InternetConnectionOption() { - InternetConnectionOption.Size = Marshal.SizeOf(typeof(InternetConnectionOption)); + Size = Marshal.SizeOf(typeof(InternetConnectionOption)); } // Nested Types diff --git a/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs b/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs index e79e5a4d..7c5410ca 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.IO; using System.Text; using System.Threading; -using v2rayN.Base; using v2rayN.Mode; using v2rayN.Properties; using v2rayN.Tool; @@ -69,10 +68,10 @@ namespace v2rayN.HttpProxyHandler else { // restore user settings - var flags = _userSettings.Flags; - var proxy_server = _userSettings.ProxyServer ?? "-"; - var bypass_list = _userSettings.BypassList ?? "-"; - var pac_url = _userSettings.PacUrl ?? "-"; + string flags = _userSettings.Flags; + string proxy_server = _userSettings.ProxyServer ?? "-"; + string bypass_list = _userSettings.BypassList ?? "-"; + string pac_url = _userSettings.PacUrl ?? "-"; arguments = $"set {flags} {proxy_server} {bypass_list} {pac_url}"; // have to get new settings @@ -110,7 +109,7 @@ namespace v2rayN.HttpProxyHandler using (AutoResetEvent outputWaitHandle = new AutoResetEvent(false)) using (AutoResetEvent errorWaitHandle = new AutoResetEvent(false)) { - using (var process = new Process()) + using (Process process = new Process()) { // Configure the process using the StartInfo properties. process.StartInfo.FileName = Utils.GetTempPath("sysproxy.exe"); @@ -167,10 +166,10 @@ namespace v2rayN.HttpProxyHandler // log the arguments throw new Exception(process.StartInfo.Arguments); } - var stderr = error.ToString(); - var stdout = output.ToString(); + string stderr = error.ToString(); + string stdout = output.ToString(); - var exitCode = process.ExitCode; + int exitCode = process.ExitCode; if (exitCode != (int)RET_ERRORS.RET_NO_ERROR) { throw new Exception(stderr); diff --git a/v2rayN/v2rayN/Mode/Config.cs b/v2rayN/v2rayN/Mode/Config.cs index 76c6e04f..e0ef85ff 100644 --- a/v2rayN/v2rayN/Mode/Config.cs +++ b/v2rayN/v2rayN/Mode/Config.cs @@ -114,6 +114,20 @@ namespace v2rayN.Mode get; set; } + /// + /// 自定义服务器下载测速url + /// + public string speedTestUrl + { + get; set; + } + /// + /// 自定义“服务器真连接延迟”测试url + /// + public string speedPingTestUrl + { + get; set; + } /// /// 自定义GFWList url /// @@ -138,6 +152,14 @@ namespace v2rayN.Mode get; set; } + /// + /// 去重时优先保留较旧(顶部)节点 + /// + public bool keepOlderDedupl + { + get; set; + } + /// /// 视图刷新率 /// @@ -419,7 +441,7 @@ namespace v2rayN.Mode public string getItemId() { - var itemId = $"{address}{port}{requestHost}{path}"; + string itemId = $"{address}{port}{requestHost}{path}"; itemId = Utils.Base64Encode(itemId); return itemId; } diff --git a/v2rayN/v2rayN/Program.cs b/v2rayN/v2rayN/Program.cs index e40749ef..bd6e36d3 100644 --- a/v2rayN/v2rayN/Program.cs +++ b/v2rayN/v2rayN/Program.cs @@ -26,7 +26,7 @@ namespace v2rayN } Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); - Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); + Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); @@ -46,7 +46,7 @@ namespace v2rayN //设置语言环境 string lang = Utils.RegReadValue(Global.MyRegPath, Global.MyRegKeyLanguage, "zh-Hans"); - System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); + Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); @@ -100,7 +100,7 @@ namespace v2rayN return null; } - static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) + static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { Utils.SaveLog("Application_ThreadException", e.Exception); } @@ -112,7 +112,7 @@ namespace v2rayN static bool UnzipLibs() { - var fileName = Utils.GetPath("libs.zip"); + string fileName = Utils.GetPath("libs.zip"); if (!FileManager.ByteArrayToFile(fileName, Resources.libs)) { return false; diff --git a/v2rayN/v2rayN/Properties/AssemblyInfo.cs b/v2rayN/v2rayN/Properties/AssemblyInfo.cs index 32fb1a67..37de4210 100644 --- a/v2rayN/v2rayN/Properties/AssemblyInfo.cs +++ b/v2rayN/v2rayN/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 diff --git a/v2rayN/v2rayN/Resx/ResUI.resx b/v2rayN/v2rayN/Resx/ResUI.resx index 0767dc8c..8718f93d 100644 --- a/v2rayN/v2rayN/Resx/ResUI.resx +++ b/v2rayN/v2rayN/Resx/ResUI.resx @@ -123,9 +123,36 @@ Batch export share URL to clipboard successfully + + Please check the server settings first + + + configuration format is incorrect + + + Note that custom configuration relies entirely on your own configuration and does not work with all settings. The system agent is available when the socks port is equal to the port in the settings in the custom configuration inbound. + + + DOWN + + + Whether to download? {0} + + + Failed to convert configuration file + + + Failed to generate default configuration file + + + Failed to get the default configuration + Failed to import custom configuration server + + Failed to read configuration file + Please fill in the correct format extra ID @@ -147,75 +174,6 @@ Please fill in the user ID - - This feature relies on the Http global proxy, please set it correctly first. - - - non-Vmess service, this feature is invalid - - - Scan completed, no valid QR code found - - - operation failed, please check retry - - - Please Fill Remarks - - - Please select the encryption method - - - Please select an agreement - - - Please select the server first - - - Successfully imported custom configuration server - - - {0} servers have been imported from clipboard. - - - Note that custom configuration relies entirely on your own configuration and does not work with all settings. The system agent is available when the socks port is equal to the port in the settings in the custom configuration inbound. - - - The client configuration file is saved at: {0} - - - The server configuration file is saved at: {0} - - - Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node! - - - Scan import URL successfully - - - Whether to download? {0} - - - Are you sure to remove the server? - - - Please check the server settings first - - - configuration format is incorrect - - - Failed to convert configuration file - - - Failed to generate default configuration file - - - Failed to get the default configuration - - - Failed to read configuration file - is not the correct client configuration file, please check @@ -228,24 +186,11 @@ Initial Configuration - - Non-vmess or ss protocol - - - Successful configuration -{0} - - - V2ray-core not found, please download: {0} - - - {0} already up to date. - {0} already up to date. - - Start service ({0})... + + {0} already up to date. Address @@ -268,9 +213,24 @@ Test Results + + Today download traffic + + + Today upload traffic + + + Total download traffic + + + Total upload traffic + Transport + + MediumFresh + Clear original subscription content @@ -325,34 +285,74 @@ Update V2rayCore successfully! Restarting service... - - MediumFresh + + This feature relies on the Http global proxy, please set it correctly first. + + + Non-vmess or ss protocol + + + non-Vmess service, this feature is invalid + + + V2ray-core not found, please download: {0} + + + Scan completed, no valid QR code found + + + operation failed, please check retry + + + Please Fill Remarks + + + Please select the encryption method + + + Please select an agreement + + + Please select the server first QuickFresh + + Servers deduplication completed. Old: {0}, New: {1}. + + + Are you sure to remove the server? + + + The client configuration file is saved at: {0} + + + The server configuration file is saved at: {0} + SlowFresh - - DOWN - - - Today download traffic - - - Today upload traffic - - - Total download traffic - - - Total upload traffic + + Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node! PAC failed to start. Run it with Admin right. - - Servers deduplication completed. Old: {0}, New: {1}. + + Start service ({0})... + + + Successful configuration +{0} + + + Successfully imported custom configuration server + + + {0} servers have been imported from clipboard. + + + Scan import URL successfully \ No newline at end of file diff --git a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx index 5a3a465a..7e8cab61 100644 --- a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx @@ -123,9 +123,36 @@ 批量导出分享URL至剪贴板成功 + + 请先检查服务器设置 + + + 配置格式不正确 + + + 注意,自定义配置完全依赖您自己的配置,不能使用所有设置功能。在自定义配置inbound中有socks port等于设置中的port时,系统代理才可用 + + + 下载 + + + 是否下载? {0} + + + 转换配置文件失败 + + + 生成默认配置文件失败 + + + 取得默认配置失败 + 导入自定义配置服务器失败 + + 读取配置文件失败 + 请填写正确格式额外ID @@ -147,75 +174,6 @@ 请填写用户ID - - 此功能依赖Http全局代理,请先设置正确。 - - - 非Vmess服务,此功能无效 - - - 扫描完成,未发现有效二维码 - - - 操作失败,请检查重试 - - - 请填写备注 - - - 请选择加密方式 - - - 请选择协议 - - - 请先选择服务器 - - - 成功导入自定义配置服务器 - - - 成功从剪贴板导入 {0} 个服务器 - - - 注意,自定义配置完全依赖您自己的配置,不能使用所有设置功能。在自定义配置inbound中有socks port等于设置中的port时,系统代理才可用 - - - 客户端配置文件保存在:{0} - - - 服务端配置文件保存在:{0} - - - 注意:此功能依赖Http全局代理!测试完成后,请手工调整Http全局代理和活动节点。 - - - 扫描导入URL成功 - - - 是否下载? {0} - - - 是否确定移除服务器? - - - 请先检查服务器设置 - - - 配置格式不正确 - - - 转换配置文件失败 - - - 生成默认配置文件失败 - - - 取得默认配置失败 - - - 读取配置文件失败 - 不是正确的客户端配置文件,请检查 @@ -228,24 +186,11 @@ 初始化配置 - - 非vmess或ss协议 - - - 配置成功 -{0} - - - 找不到 v2ray-core,下载地址: {0} - - - {0} 已是最新版本。 - {0} 已是最新版本。 - - 启动服务({0})... + + {0} 已是最新版本。 地址 @@ -268,9 +213,24 @@ 测试结果 + + 今日下载 + + + 今日上传 + + + 总下载 + + + 总上传 + 传输协议 + + 中等 + 清除原订阅内容 @@ -325,34 +285,74 @@ 更新V2rayCore成功!正在重启服务... - - 中等 + + 此功能依赖Http全局代理,请先设置正确。 + + + 非vmess或ss协议 + + + 非Vmess服务,此功能无效 + + + 找不到 v2ray-core,下载地址: {0} + + + 扫描完成,未发现有效二维码 + + + 操作失败,请检查重试 + + + 请填写备注 + + + 请选择加密方式 + + + 请选择协议 + + + 请先选择服务器 + + 服务器去重完成。原数量: {0},现数量: {1} + + + 是否确定移除服务器? + + + 客户端配置文件保存在:{0} + + + 服务端配置文件保存在:{0} + - - 下载 - - - 今日下载 - - - 今日上传 - - - 总下载 - - - 总上传 + + 注意:此功能依赖Http全局代理!测试完成后,请手工调整Http全局代理和活动节点。 PAC服务启动失败,请用管理员启动 - - 服务器去重完成。原数量: {0},现数量: {1} + + 启动服务({0})... + + + 配置成功 +{0} + + + 成功导入自定义配置服务器 + + + 成功从剪贴板导入 {0} 个服务器 + + + 扫描导入URL成功 \ No newline at end of file diff --git a/v2rayN/v2rayN/Tool/FileManager.cs b/v2rayN/v2rayN/Tool/FileManager.cs index 4bfc0830..bd5ebf93 100644 --- a/v2rayN/v2rayN/Tool/FileManager.cs +++ b/v2rayN/v2rayN/Tool/FileManager.cs @@ -11,7 +11,7 @@ namespace v2rayN.Tool { try { - using (var fs = new FileStream(fileName, FileMode.Create, FileAccess.Write)) + using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write)) fs.Write(content, 0, content.Length); return true; } @@ -31,8 +31,8 @@ namespace v2rayN.Tool byte[] buffer = new byte[4096]; int n; - using (var fs = File.Create(fileName)) - using (var input = new GZipStream(new MemoryStream(content), + using (FileStream fs = File.Create(fileName)) + using (GZipStream input = new GZipStream(new MemoryStream(content), CompressionMode.Decompress, false)) { while ((n = input.Read(buffer, 0, buffer.Length)) > 0) @@ -56,8 +56,8 @@ namespace v2rayN.Tool { try { - using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) - using (var sr = new StreamReader(fs, encoding)) + using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + using (StreamReader sr = new StreamReader(fs, encoding)) { return sr.ReadToEnd(); } diff --git a/v2rayN/v2rayN/Tool/Job.cs b/v2rayN/v2rayN/Tool/Job.cs index daee62cf..66bfb128 100644 --- a/v2rayN/v2rayN/Tool/Job.cs +++ b/v2rayN/v2rayN/Tool/Job.cs @@ -16,13 +16,13 @@ namespace v2rayN public Job() { handle = CreateJobObject(IntPtr.Zero, null); - var extendedInfoPtr = IntPtr.Zero; - var info = new JOBOBJECT_BASIC_LIMIT_INFORMATION + IntPtr extendedInfoPtr = IntPtr.Zero; + JOBOBJECT_BASIC_LIMIT_INFORMATION info = new JOBOBJECT_BASIC_LIMIT_INFORMATION { LimitFlags = 0x2000 }; - var extendedInfo = new JOBOBJECT_EXTENDED_LIMIT_INFORMATION + JOBOBJECT_EXTENDED_LIMIT_INFORMATION extendedInfo = new JOBOBJECT_EXTENDED_LIMIT_INFORMATION { BasicLimitInformation = info }; @@ -50,7 +50,7 @@ namespace v2rayN public bool AddProcess(IntPtr processHandle) { - var succ = AssignProcessToJobObject(handle, processHandle); + bool succ = AssignProcessToJobObject(handle, processHandle); if (!succ) { diff --git a/v2rayN/v2rayN/Tool/UI.cs b/v2rayN/v2rayN/Tool/UI.cs index 267c8366..b6160d34 100644 --- a/v2rayN/v2rayN/Tool/UI.cs +++ b/v2rayN/v2rayN/Tool/UI.cs @@ -1,5 +1,4 @@ -using System.Globalization; -using System.Windows.Forms; +using System.Windows.Forms; namespace v2rayN { diff --git a/v2rayN/v2rayN/Tool/UIRes.cs b/v2rayN/v2rayN/Tool/UIRes.cs index a6b455a9..f0660435 100644 --- a/v2rayN/v2rayN/Tool/UIRes.cs +++ b/v2rayN/v2rayN/Tool/UIRes.cs @@ -10,7 +10,7 @@ namespace v2rayN static string LoadString(ResourceManager resMgr, string key) { - var value = resMgr.GetString(key); + string value = resMgr.GetString(key); if (value == null) { throw new KeyNotFoundException($"key: {key}"); diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index b7da94e8..f6f0bb3c 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/v2rayN/v2rayN/Tool/Utils.cs @@ -39,7 +39,7 @@ namespace v2rayN try { - var assembly = Assembly.GetExecutingAssembly(); + Assembly assembly = Assembly.GetExecutingAssembly(); using (Stream stream = assembly.GetManifestResourceStream(res)) using (StreamReader reader = new StreamReader(stream)) { @@ -124,7 +124,7 @@ namespace v2rayN int result = -1; try { - using (StreamWriter file = System.IO.File.CreateText(filePath)) + using (StreamWriter file = File.CreateText(filePath)) { //JsonSerializer serializer = new JsonSerializer(); JsonSerializer serializer = new JsonSerializer() { Formatting = Formatting.Indented }; @@ -194,7 +194,7 @@ namespace v2rayN { try { - var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); + byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); return Convert.ToBase64String(plainTextBytes); } catch (Exception ex) @@ -272,20 +272,20 @@ namespace v2rayN /// 单位 public static void ToHumanReadable(ulong amount, out double result, out string unit) { - var factor = 1024u; - var KBs = amount / factor; + uint factor = 1024u; + ulong KBs = amount / factor; if (KBs > 0) { // multi KB - var MBs = KBs / factor; + ulong MBs = KBs / factor; if (MBs > 0) { // multi MB - var GBs = MBs / factor; + ulong GBs = MBs / factor; if (GBs > 0) { // multi GB - var TBs = GBs / factor; + ulong TBs = GBs / factor; if (TBs > 0) { // 你是魔鬼吗? 用这么多流量 @@ -314,23 +314,39 @@ namespace v2rayN public static string HumanFy(ulong amount) { - double result; - string unit; - ToHumanReadable(amount, out result, out unit); + ToHumanReadable(amount, out double result, out string unit); return $"{string.Format("{0:f1}", result)} {unit}"; } - public static void DedupServerList(List source, out List result) + public static void DedupServerList(List source, out List result, bool keepOlder) { - var list = new List(); - foreach (var item in source) + List list = new List(); + if (!keepOlder) source.Reverse(); // Remove the early items first + + bool _isAdded(Mode.VmessItem o, Mode.VmessItem n) { - if (!list.Exists(i => item.address == i.address && item.port == i.port && item.path == i.path)) + return o.configVersion == n.configVersion && + o.configType == n.configType && + o.address == n.address && + o.port == n.port && + o.id == n.id && + o.alterId == n.alterId && + o.security == n.security && + o.network == n.network && + o.headerType == n.headerType && + o.requestHost == n.requestHost && + o.path == n.path && + o.streamSecurity == n.streamSecurity; + // skip (will remove) different remarks + } + foreach (Mode.VmessItem item in source) + { + if (!list.Exists(i => _isAdded(i, item))) { list.Add(item); } } - + if (!keepOlder) list.Reverse(); result = list; } @@ -348,7 +364,7 @@ namespace v2rayN { try { - int var1 = Utils.ToInt(oText); + int var1 = ToInt(oText); return true; } catch @@ -392,7 +408,7 @@ namespace v2rayN //可能是CIDR if (ip.IndexOf(@"/") > 0) { - var cidr = ip.Split('/'); + string[] cidr = ip.Split('/'); if (cidr.Length == 2) { if (!IsNumberic(cidr[0])) @@ -497,7 +513,7 @@ namespace v2rayN { try { - var value = RegReadValue(autoRunRegPath, autoRunName, ""); + string value = RegReadValue(autoRunRegPath, autoRunName, ""); string exePath = GetExePath(); if (value?.Equals(exePath) == true) { @@ -517,7 +533,7 @@ namespace v2rayN public static string GetPath(string fileName) { string startupPath = StartupPath(); - if (Utils.IsNullOrEmpty(fileName)) + if (IsNullOrEmpty(fileName)) { return startupPath; } @@ -817,7 +833,7 @@ namespace v2rayN sb.Write(buffer, 0, n); } } - return System.Text.Encoding.UTF8.GetString(sb.ToArray()); + return Encoding.UTF8.GetString(sb.ToArray()); } } @@ -899,10 +915,10 @@ namespace v2rayN GraphicsUnit.Pixel); } - var source = new BitmapLuminanceSource(target); - var bitmap = new BinaryBitmap(new HybridBinarizer(source)); + BitmapLuminanceSource source = new BitmapLuminanceSource(target); + BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); QRCodeReader reader = new QRCodeReader(); - var result = reader.decode(bitmap); + Result result = reader.decode(bitmap); if (result != null) { ret = result.Text; diff --git a/v2rayN/v2rayUpgrade/MainForm.cs b/v2rayN/v2rayUpgrade/MainForm.cs index 64982a12..1bc22b7f 100644 --- a/v2rayN/v2rayUpgrade/MainForm.cs +++ b/v2rayN/v2rayUpgrade/MainForm.cs @@ -35,7 +35,7 @@ namespace v2rayUpgrade Process[] existing = Process.GetProcessesByName("v2rayN"); foreach (Process p in existing) { - var path = p.MainModule.FileName; + string path = p.MainModule.FileName; if (path == GetPath("v2rayN.exe")) { p.Kill(); @@ -49,7 +49,7 @@ namespace v2rayUpgrade return; } - var fileName = GetPath(_tempFileName); + string fileName = GetPath(_tempFileName); try { File.Delete(fileName); @@ -60,7 +60,7 @@ namespace v2rayUpgrade return; } - var startKey = "v2rayN/"; + string startKey = "v2rayN/"; using (ZipArchive archive = ZipFile.OpenRead(fileName)) { @@ -70,7 +70,7 @@ namespace v2rayUpgrade { continue; } - var fullName = entry.FullName; + string fullName = entry.FullName; if (fullName.StartsWith(startKey)) { fullName = fullName.Substring(startKey.Length, fullName.Length - startKey.Length); diff --git a/v2rayN/v2rayUpgrade/Program.cs b/v2rayN/v2rayUpgrade/Program.cs index 8d8d0633..c7971134 100644 --- a/v2rayN/v2rayUpgrade/Program.cs +++ b/v2rayN/v2rayUpgrade/Program.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using System.Windows.Forms; namespace v2rayUpgrade diff --git a/v2rayN/v2rayUpgrade/Properties/AssemblyInfo.cs b/v2rayN/v2rayUpgrade/Properties/AssemblyInfo.cs index c32abbf1..654bd7b5 100644 --- a/v2rayN/v2rayUpgrade/Properties/AssemblyInfo.cs +++ b/v2rayN/v2rayUpgrade/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下