Compare commits

..

46 Commits
5.8 ... 5.16

Author SHA1 Message Date
2dust
0e55a859ea Update AssemblyInfo.cs 2022-04-14 18:30:15 +08:00
2dust
0b1ec520f4 fix 2022-04-14 17:01:51 +08:00
2dust
fcc5f29882 add auto update sub setting 2022-04-14 16:49:12 +08:00
2dust
d431c63245 Merge pull request #2192 from FrzMtrsprt/patch-1
Add support for Clash's modern CPU executable
2022-04-14 15:08:08 +08:00
FrzMtrsprt
15f8db64e7 Add support for Clash's modern CPU executable
Add support for clash-windows-amd64-v3.exe
2022-04-14 12:13:22 +08:00
2dust
c2ea14151e add naiveproxy 2022-04-14 11:10:06 +08:00
2dust
977f0428e2 Refactor Inbound 2022-04-14 09:56:11 +08:00
2dust
f110446738 Update AssemblyInfo.cs 2022-04-13 19:36:41 +08:00
2dust
90289120d3 add clash.meta core 2022-04-13 09:21:40 +08:00
2dust
688f206555 Refactor main message control 2022-04-13 09:21:17 +08:00
2dust
38c739c45d Improve test 2022-04-12 20:24:48 +08:00
2dust
73c79ca7bf Update AssemblyInfo.cs 2022-04-12 16:58:31 +08:00
2dust
978975ee2d update package 2022-04-12 16:58:09 +08:00
2dust
d7dc0dff50 Adjusting the tray server display 2022-04-12 14:49:57 +08:00
2dust
a3aa6c045f Improve speed test 2022-04-12 13:38:42 +08:00
2dust
785ebc49fc fix clash port 2022-04-12 13:38:10 +08:00
2dust
fde1c98ddd add group sort 2022-04-12 13:37:41 +08:00
2dust
024040163a Update AssemblyInfo.cs 2022-04-11 19:16:52 +08:00
2dust
e95b5e04c0 remove expired tls 2022-04-11 19:16:35 +08:00
2dust
815826c856 Refactor download/update/speedtest 2022-04-11 15:26:32 +08:00
2dust
1c5cc190c5 modify res 2022-04-11 15:24:59 +08:00
2dust
50b109ca71 Auto update subscription 2022-04-11 15:24:24 +08:00
2dust
3aa48a9a3e Update AssemblyInfo.cs 2022-04-07 20:36:10 +08:00
2dust
09702b9bde fix bugs 2022-04-07 17:05:56 +08:00
2dust
35f6cd3d9c Merge pull request #2164 from Lemonawa/master
Update issue templates
2022-04-06 19:49:52 +08:00
Lemonawa
b62f1786a9 Update issue templates 2022-04-05 23:19:37 +08:00
Lemonawa
b21ad28d5b Delete config.yaml 2022-04-05 23:10:16 +08:00
Lemonawa
8d66c0d180 Delete issue_template.md 2022-04-05 23:10:08 +08:00
Lemonawa
ec8aa0df18 Update issue templates 2022-04-05 23:09:30 +08:00
Lemonawa
e824d8e91d Create config.yaml 2022-04-05 23:06:42 +08:00
2dust
b919422ec4 Update AssemblyInfo.cs 2022-04-04 19:34:32 +08:00
2dust
a8bc9ce605 Refactor local listening port 2022-04-04 19:32:16 +08:00
2dust
e2f399eeb1 Update AssemblyInfo.cs 2022-04-03 17:03:21 +08:00
2dust
82924278b5 Delete log files older than one month 2022-04-03 17:01:45 +08:00
2dust
bb828a4e06 modify some text 2022-04-03 17:00:47 +08:00
2dust
74933ac146 Merge pull request #2151 from zhaogarvie/master
过滤器添加快捷按钮
2022-04-01 20:37:41 +08:00
uniceguy
0d315f0dc3 过滤器添加快捷按钮 2022-04-01 19:55:16 +08:00
2dust
372ee346dc Update README.md 2022-04-01 19:33:31 +08:00
2dust
cb462ab944 Update README.md 2022-04-01 19:27:44 +08:00
2dust
606da79372 Update AssemblyInfo.cs 2022-04-01 18:10:48 +08:00
2dust
0801c3db64 Refactor stat update 2022-04-01 18:09:58 +08:00
2dust
35deb0c915 Merge pull request #2148 from zhaogarvie/master
保存自定义路由信息时先排序后输出
2022-04-01 18:07:25 +08:00
uniceguy
fd4d712688 保存自定义路由信息时先排序后输出 2022-04-01 13:21:22 +08:00
2dust
354fc618b0 fix encode issue 2022-03-31 20:19:15 +08:00
2dust
82b6ee5ad2 Refactor ResUI 2022-03-31 19:53:58 +08:00
2dust
645e6c4ec0 Update ConfigHandler.cs 2022-03-28 19:21:31 +08:00
60 changed files with 4570 additions and 3713 deletions

View File

@@ -1,3 +1,12 @@
---
name: Bug 报告
about: 在提出问题前请先自行排除服务器端问题和升级到最新客户端,同时也请通过搜索确认是否有人提出过相同问题。
title: "[BUG]"
labels: bug
assignees: ''
---
在提出问题前请先自行排除服务器端问题和升级到最新客户端,同时也请通过搜索确认是否有人提出过相同问题。 在提出问题前请先自行排除服务器端问题和升级到最新客户端,同时也请通过搜索确认是否有人提出过相同问题。
### 预期行为 ### 预期行为
@@ -22,4 +31,3 @@
### 环境信息(客户端请升级至最新正式版) ### 环境信息(客户端请升级至最新正式版)
### 额外信息(可选) ### 额外信息(可选)

20
.github/ISSUE_TEMPLATE/feature---.md vendored Normal file
View File

@@ -0,0 +1,20 @@
---
name: Feature 请求
about: 为这个项目提出一个建议
title: "[Feature request]"
labels: enhancement
assignees: ''
---
**你的功能请求是否与一个问题有关?请描述。**
清楚而简洁地描述问题是什么。例如。我总是感到沮丧,当 [...]
**描述你希望的解决方案**
对你希望发生的事情进行清晰、简明的描述。
**描述你所考虑的替代方案**
对你考虑过的任何替代解决方案或功能进行清晰、简洁的描述。
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -1,12 +1,18 @@
# v2rayN # v2rayN
A V2Ray client for Windows, support [Xray core](https://github.com/XTLS/Xray-core) and [v2fly core](https://github.com/v2fly/v2ray-core) A V2Ray client for Windows, support [Xray core](https://github.com/XTLS/Xray-core) and [v2fly core](https://github.com/v2fly/v2ray-core)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/2dust/v2rayN)](https://github.com/2dust/v2rayN/commits/master)
[![CodeFactor](https://www.codefactor.io/repository/github/2dust/v2rayn/badge)](https://www.codefactor.io/repository/github/2dust/v2rayn)
[![GitHub Releases](https://img.shields.io/github/downloads/2dust/v2rayN/latest/total?logo=github)](https://github.com/2dust/v2rayN/releases)
[![Chat on Telegram](https://img.shields.io/badge/Chat%20on-Telegram-brightgreen.svg)](https://t.me/v2rayn)
### How to use ### How to use
- If you are newbie please download v2rayN-Core.zip from releases - If you are newbie please download v2rayN-Core.zip from releases
- Otherwise please download v2rayN.zip (Also need to download v2ray core in the same folder) - Otherwise please download v2rayN.zip (Also need to download v2ray core in the same folder)
- Run v2rayN.exe - Run v2rayN.exe
### Requirements ### Requirements
- Microsoft [.NET Framework 4.8](https://docs.microsoft.com/zh-cn/dotnet/framework/install/guide-for-developers) - Microsoft [.NET Framework 4.8](https://dotnet.microsoft.com/zh-cn/download/dotnet-framework/thank-you/net48-web-installer)
- v2fly core [https://github.com/v2fly/v2ray-core/releases](https://github.com/v2fly/v2ray-core/releases) - v2fly core [https://github.com/v2fly/v2ray-core/releases](https://github.com/v2fly/v2ray-core/releases)
- Xray core [https://github.com/XTLS/Xray-core/releases](https://github.com/XTLS/Xray-core/releases) - Xray core [https://github.com/XTLS/Xray-core/releases](https://github.com/XTLS/Xray-core/releases)

View File

@@ -0,0 +1,235 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
namespace v2rayN.Base
{
/// <summary>
/// </summary>
public class HttpClientHelper
{
private static HttpClientHelper httpClientHelper = null;
private HttpClient httpClient;
/// <summary>
/// </summary>
private HttpClientHelper() { }
/// <summary>
/// </summary>
/// <returns></returns>
public static HttpClientHelper GetInstance()
{
if (httpClientHelper != null)
{
return httpClientHelper;
}
else
{
HttpClientHelper httpClientHelper = new HttpClientHelper();
HttpClientHandler handler = new HttpClientHandler() { UseCookies = false };
httpClientHelper.httpClient = new HttpClient(handler);
return httpClientHelper;
}
}
public async Task<string> GetAsync(string url)
{
if (string.IsNullOrEmpty(url))
{
return null;
}
try
{
HttpResponseMessage response = await httpClient.GetAsync(url);
return await response.Content.ReadAsStringAsync();
}
catch
{
}
return null;
}
public async Task<string> GetAsync(HttpClient client, string url)
{
if (string.IsNullOrEmpty(url))
{
return null;
}
try
{
var cts = new CancellationTokenSource();
cts.CancelAfter(5000);
HttpResponseMessage response = await client.GetAsync(url, cts.Token);
return await response.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
Utils.SaveLog("GetAsync", ex);
}
return null;
}
public async Task PutAsync(string url, Dictionary<string, string> headers)
{
var myContent = Utils.ToJson(headers);
var buffer = System.Text.Encoding.UTF8.GetBytes(myContent);
var byteContent = new ByteArrayContent(buffer);
byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
var result = await httpClient.PutAsync(url, byteContent);
}
public async Task DownloadFileAsync(HttpClient client, string url, string fileName, IProgress<double> progress, CancellationToken token)
{
if (string.IsNullOrEmpty(url))
{
throw new ArgumentNullException("url");
}
if (string.IsNullOrEmpty(fileName))
{
throw new ArgumentNullException("fileName");
}
if (File.Exists(fileName))
{
File.Delete(fileName);
}
var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead, token);
if (!response.IsSuccessStatusCode)
{
throw new Exception(string.Format("The request returned with HTTP status code {0}", response.StatusCode));
}
var total = response.Content.Headers.ContentLength.HasValue ? response.Content.Headers.ContentLength.Value : -1L;
var canReportProgress = total != -1 && progress != null;
using (var stream = await response.Content.ReadAsStreamAsync())
{
using (var file = File.Create(fileName))
{
var totalRead = 0L;
var buffer = new byte[1024 * 1024];
var isMoreToRead = true;
var progressPercentage = 0;
do
{
token.ThrowIfCancellationRequested();
var read = await stream.ReadAsync(buffer, 0, buffer.Length, token);
if (read == 0)
{
isMoreToRead = false;
}
else
{
var data = new byte[read];
buffer.ToList().CopyTo(0, data, 0, read);
// TODO: put here the code to write the file to disk
file.Write(data, 0, read);
totalRead += read;
if (canReportProgress)
{
var percent = Convert.ToInt32((totalRead * 1d) / (total * 1d) * 100);
if (progressPercentage != percent && percent % 10 == 0)
{
progressPercentage = percent;
progress.Report(percent);
}
}
}
} while (isMoreToRead);
file.Close();
if (canReportProgress)
{
progress.Report(101);
}
}
}
}
public async Task DownloadDataAsync4Speed(HttpClient client, string url, IProgress<double> progress, CancellationToken token)
{
if (string.IsNullOrEmpty(url))
{
throw new ArgumentNullException("url");
}
var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead, token);
if (!response.IsSuccessStatusCode)
{
throw new Exception(string.Format("The request returned with HTTP status code {0}", response.StatusCode));
}
var total = response.Content.Headers.ContentLength.HasValue ? response.Content.Headers.ContentLength.Value : -1L;
var canReportProgress = total != -1 && progress != null;
using (var stream = await response.Content.ReadAsStreamAsync())
{
var totalRead = 0L;
var buffer = new byte[1024 * 64];
var isMoreToRead = true;
var progressPercentage = 0;
DateTime totalDatetime = DateTime.Now;
do
{
if (token.IsCancellationRequested)
{
if (totalRead > 0)
{
return;
}
else
{
token.ThrowIfCancellationRequested();
}
}
var read = await stream.ReadAsync(buffer, 0, buffer.Length, token);
if (read == 0)
{
isMoreToRead = false;
}
else
{
var data = new byte[read];
buffer.ToList().CopyTo(0, data, 0, read);
// TODO:
totalRead += read;
if (canReportProgress)
{
TimeSpan ts = (DateTime.Now - totalDatetime);
var speed = totalRead * 1d / ts.TotalMilliseconds / 1000;
var percent = Convert.ToInt32((totalRead * 1d) / (total * 1d) * 100);
if (progressPercentage != percent)
{
progressPercentage = percent;
progress.Report(speed);
}
}
}
} while (isMoreToRead);
}
}
}
}

View File

@@ -1,37 +0,0 @@
using System;
using System.Net;
namespace v2rayN.Base
{
class WebClientEx : WebClient
{
public int Timeout
{
get; set;
}
public WebClientEx(int timeout = 3000)
{
Timeout = timeout;
}
protected override WebRequest GetWebRequest(Uri address)
{
HttpWebRequest request;
request = (HttpWebRequest)base.GetWebRequest(address);
request.Timeout = Timeout;
request.ReadWriteTimeout = Timeout;
//request.AllowAutoRedirect = false;
//request.AllowWriteStreamBuffering = true;
request.ServicePoint.BindIPEndPointDelegate = (servicePoint, remoteEndPoint, retryCount) =>
{
if (remoteEndPoint.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
return new IPEndPoint(IPAddress.IPv6Any, 0);
else
return new IPEndPoint(IPAddress.Any, 0);
};
return request;
}
}
}

View File

@@ -4,6 +4,7 @@ using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -19,7 +20,9 @@ namespace v2rayN.Forms
{ {
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray()); cmbCoreType.Items.AddRange(Global.coreTypes.ToArray());
cmbCoreType.Items.Add("clash"); cmbCoreType.Items.Add("clash");
cmbCoreType.Items.Add("clash_meta");
cmbCoreType.Items.Add("hysteria"); cmbCoreType.Items.Add("hysteria");
cmbCoreType.Items.Add("naiveproxy");
cmbCoreType.Items.Add(string.Empty); cmbCoreType.Items.Add(string.Empty);
txtAddress.ReadOnly = true; txtAddress.ReadOnly = true;
@@ -67,12 +70,12 @@ namespace v2rayN.Forms
string remarks = txtRemarks.Text; string remarks = txtRemarks.Text;
if (Utils.IsNullOrEmpty(remarks)) if (Utils.IsNullOrEmpty(remarks))
{ {
UI.Show(UIRes.I18N("PleaseFillRemarks")); UI.Show(ResUI.PleaseFillRemarks);
return; return;
} }
if (Utils.IsNullOrEmpty(txtAddress.Text)) if (Utils.IsNullOrEmpty(txtAddress.Text))
{ {
UI.Show(UIRes.I18N("FillServerAddressCustom")); UI.Show(ResUI.FillServerAddressCustom);
return; return;
} }
vmessItem.remarks = remarks; vmessItem.remarks = remarks;
@@ -91,7 +94,7 @@ namespace v2rayN.Forms
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("OperationFailed")); UI.ShowWarning(ResUI.OperationFailed);
} }
} }
@@ -109,7 +112,7 @@ namespace v2rayN.Forms
private void btnBrowse_Click(object sender, EventArgs e) private void btnBrowse_Click(object sender, EventArgs e)
{ {
UI.Show(UIRes.I18N("CustomServerTips")); UI.Show(ResUI.CustomServerTips);
OpenFileDialog fileDialog = new OpenFileDialog OpenFileDialog fileDialog = new OpenFileDialog
{ {
@@ -132,11 +135,11 @@ namespace v2rayN.Forms
if (ConfigHandler.AddCustomServer(ref config, vmessItem, false) == 0) if (ConfigHandler.AddCustomServer(ref config, vmessItem, false) == 0)
{ {
BindingServer(); BindingServer();
UI.Show(UIRes.I18N("SuccessfullyImportedCustomServer")); UI.Show(ResUI.SuccessfullyImportedCustomServer);
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("FailedImportedCustomServer")); UI.ShowWarning(ResUI.FailedImportedCustomServer);
} }
} }
@@ -145,7 +148,7 @@ namespace v2rayN.Forms
var address = txtAddress.Text; var address = txtAddress.Text;
if (Utils.IsNullOrEmpty(address)) if (Utils.IsNullOrEmpty(address))
{ {
UI.Show(UIRes.I18N("FillServerAddressCustom")); UI.Show(ResUI.FillServerAddressCustom);
return; return;
} }

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -194,24 +195,24 @@ namespace v2rayN.Forms
if (Utils.IsNullOrEmpty(address)) if (Utils.IsNullOrEmpty(address))
{ {
UI.Show(UIRes.I18N("FillServerAddress")); UI.Show(ResUI.FillServerAddress);
return; return;
} }
if (Utils.IsNullOrEmpty(port) || !Utils.IsNumberic(port)) if (Utils.IsNullOrEmpty(port) || !Utils.IsNumberic(port))
{ {
UI.Show(UIRes.I18N("FillCorrectServerPort")); UI.Show(ResUI.FillCorrectServerPort);
return; return;
} }
if (eConfigType == EConfigType.Shadowsocks) if (eConfigType == EConfigType.Shadowsocks)
{ {
if (Utils.IsNullOrEmpty(id)) if (Utils.IsNullOrEmpty(id))
{ {
UI.Show(UIRes.I18N("FillPassword")); UI.Show(ResUI.FillPassword);
return; return;
} }
if (Utils.IsNullOrEmpty(security)) if (Utils.IsNullOrEmpty(security))
{ {
UI.Show(UIRes.I18N("PleaseSelectEncryption")); UI.Show(ResUI.PleaseSelectEncryption);
return; return;
} }
} }
@@ -219,7 +220,7 @@ namespace v2rayN.Forms
{ {
if (Utils.IsNullOrEmpty(id)) if (Utils.IsNullOrEmpty(id))
{ {
UI.Show(UIRes.I18N("FillUUID")); UI.Show(ResUI.FillUUID);
return; return;
} }
} }
@@ -270,7 +271,7 @@ namespace v2rayN.Forms
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("OperationFailed")); UI.ShowWarning(ResUI.OperationFailed);
} }
} }

View File

@@ -4,6 +4,7 @@ using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -104,7 +105,7 @@ namespace v2rayN.Forms
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("OperationFailed")); UI.ShowWarning(ResUI.OperationFailed);
} }
} }

View File

@@ -33,15 +33,20 @@
this.btnRemove = new System.Windows.Forms.Button(); this.btnRemove = new System.Windows.Forms.Button();
this.txtRemarks = new System.Windows.Forms.TextBox(); this.txtRemarks = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.numSort = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
this.grbMain.SuspendLayout(); this.grbMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numSort)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// grbMain // grbMain
// //
resources.ApplyResources(this.grbMain, "grbMain"); this.grbMain.Controls.Add(this.label1);
this.grbMain.Controls.Add(this.numSort);
this.grbMain.Controls.Add(this.btnRemove); this.grbMain.Controls.Add(this.btnRemove);
this.grbMain.Controls.Add(this.txtRemarks); this.grbMain.Controls.Add(this.txtRemarks);
this.grbMain.Controls.Add(this.label2); this.grbMain.Controls.Add(this.label2);
resources.ApplyResources(this.grbMain, "grbMain");
this.grbMain.Name = "grbMain"; this.grbMain.Name = "grbMain";
this.grbMain.TabStop = false; this.grbMain.TabStop = false;
// //
@@ -63,6 +68,17 @@
resources.ApplyResources(this.label2, "label2"); resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2"; this.label2.Name = "label2";
// //
// numSort
//
resources.ApplyResources(this.numSort, "numSort");
this.numSort.Name = "numSort";
this.numSort.Leave += new System.EventHandler(this.txtRemarks_Leave);
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// GroupSettingControl // GroupSettingControl
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@@ -72,6 +88,7 @@
this.Load += new System.EventHandler(this.GroupSettingControl_Load); this.Load += new System.EventHandler(this.GroupSettingControl_Load);
this.grbMain.ResumeLayout(false); this.grbMain.ResumeLayout(false);
this.grbMain.PerformLayout(); this.grbMain.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numSort)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@@ -82,5 +99,7 @@
private System.Windows.Forms.TextBox txtRemarks; private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnRemove; private System.Windows.Forms.Button btnRemove;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.NumericUpDown numSort;
} }
} }

View File

@@ -32,6 +32,7 @@ namespace v2rayN.Forms
if (groupItem != null) if (groupItem != null)
{ {
txtRemarks.Text = groupItem.remarks.ToString(); txtRemarks.Text = groupItem.remarks.ToString();
numSort.Value = groupItem.sort;
} }
} }
private void EndBindingSub() private void EndBindingSub()
@@ -39,6 +40,7 @@ namespace v2rayN.Forms
if (groupItem != null) if (groupItem != null)
{ {
groupItem.remarks = txtRemarks.Text.TrimEx(); groupItem.remarks = txtRemarks.Text.TrimEx();
groupItem.sort = Convert.ToInt32(numSort.Value);
} }
} }
private void txtRemarks_Leave(object sender, EventArgs e) private void txtRemarks_Leave(object sender, EventArgs e)

View File

@@ -118,126 +118,177 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="grbMain.TabIndex" type="System.Int32, mscorlib"> <data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>10</value> <value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing"> <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 12</value> <value>12, 61</value>
</data> </data>
<data name="&gt;&gt;grbMain.ZOrder" xml:space="preserve"> <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Sort number</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing"> <data name="numSort.Location" type="System.Drawing.Point, System.Drawing">
<value>292, 21</value> <value>127, 57</value>
</data>
<data name="numSort.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value>
</data>
<data name="numSort.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;numSort.Name" xml:space="preserve">
<value>numSort</value>
</data>
<data name="&gt;&gt;numSort.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;numSort.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;numSort.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data> </data>
<data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>525, 21</value> <value>525, 21</value>
</data> </data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>127, 21</value> <value>75, 23</value>
</data>
<data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 25</value>
</data> </data>
<data name="btnRemove.TabIndex" type="System.Int32, mscorlib"> <data name="btnRemove.TabIndex" type="System.Int32, mscorlib">
<value>24</value> <value>24</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="btnRemove.Text" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>Remove</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;btnRemove.Name" xml:space="preserve">
<value>GroupSettingControl</value> <value>btnRemove</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>grbMain</value>
</data> </data>
<data name="&gt;&gt;btnRemove.Type" xml:space="preserve"> <data name="&gt;&gt;btnRemove.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;grbMain.Name" xml:space="preserve"> <data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>grbMain</value> <value>grbMain</value>
</data> </data>
<data name="&gt;&gt;label2.Type" xml:space="preserve"> <data name="&gt;&gt;btnRemove.ZOrder" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>2</value> <value>2</value>
</data> </data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 21</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>292, 21</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 25</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve"> <data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value> <value>label2</value>
</data> </data>
<data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>75, 23</value> <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="grbMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data> </data>
<data name="grbMain.Location" type="System.Drawing.Point, System.Drawing"> <data name="grbMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value> <value>0, 0</value>
</data> </data>
<data name="grbMain.Size" type="System.Drawing.Size, System.Drawing"> <data name="grbMain.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 61</value> <value>619, 91</value>
</data> </data>
<data name="label2.Text" xml:space="preserve"> <data name="grbMain.TabIndex" type="System.Int32, mscorlib">
<value>Remarks</value> <value>10</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>grbMain</value>
</data> </data>
<data name="grbMain.Text" xml:space="preserve"> <data name="grbMain.Text" xml:space="preserve">
<value>Group details</value> <value>Group details</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="&gt;&gt;grbMain.Name" xml:space="preserve">
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <value>grbMain</value>
<value>NoControl</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;btnRemove.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnRemove.Name" xml:space="preserve">
<value>btnRemove</value>
</data>
<data name="grbMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data> </data>
<data name="&gt;&gt;grbMain.Type" xml:space="preserve"> <data name="&gt;&gt;grbMain.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;grbMain.Parent" xml:space="preserve"> <data name="&gt;&gt;grbMain.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
</data> </data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;grbMain.ZOrder" xml:space="preserve">
<value>619, 61</value> <value>0</value>
</data>
<data name="btnRemove.Text" xml:space="preserve">
<value>Remove</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 91</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>GroupSettingControl</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root> </root>

View File

@@ -130,4 +130,7 @@
<data name="grbMain.Text" xml:space="preserve"> <data name="grbMain.Text" xml:space="preserve">
<value>分组详情</value> <value>分组详情</value>
</data> </data>
<data name="label1.Text" xml:space="preserve">
<value>排序编号</value>
</data>
</root> </root>

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -73,7 +74,7 @@ namespace v2rayN.Forms
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("OperationFailed")); UI.ShowWarning(ResUI.OperationFailed);
} }
} }

View File

@@ -70,22 +70,7 @@
this.qrCodeControl = new v2rayN.Forms.QRCodeControl(); this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.gbMsgTitle = new System.Windows.Forms.GroupBox(); this.mainMsgControl = new v2rayN.Forms.MainMsgControl();
this.txtMsgBox = new System.Windows.Forms.TextBox();
this.cmsMsgBox = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuMsgBoxSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopy = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopyAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxClear = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxAddRoutingRule = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxFilter = new System.Windows.Forms.ToolStripMenuItem();
this.ssMain = new System.Windows.Forms.StatusStrip();
this.toolSslInboundInfo = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslRoutingRule = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslServerSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank4 = new System.Windows.Forms.ToolStripStatusLabel();
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components); this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components); this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem(); this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem();
@@ -94,7 +79,6 @@
this.menuKeepNothing = new System.Windows.Forms.ToolStripMenuItem(); this.menuKeepNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuRoutings = new System.Windows.Forms.ToolStripMenuItem(); this.menuRoutings = new System.Windows.Forms.ToolStripMenuItem();
this.menuServers = new System.Windows.Forms.ToolStripMenuItem(); this.menuServers = new System.Windows.Forms.ToolStripMenuItem();
this.menuServers2 = new System.Windows.Forms.ToolStripComboBox();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.menuAddServers2 = new System.Windows.Forms.ToolStripMenuItem(); this.menuAddServers2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuScanScreen2 = new System.Windows.Forms.ToolStripMenuItem(); this.menuScanScreen2 = new System.Windows.Forms.ToolStripMenuItem();
@@ -126,8 +110,7 @@
this.tsbCheckUpdateCore = new System.Windows.Forms.ToolStripMenuItem(); this.tsbCheckUpdateCore = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateXrayCore = new System.Windows.Forms.ToolStripMenuItem(); this.tsbCheckUpdateXrayCore = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator();
this.tsbCheckUpdateGeoSite = new System.Windows.Forms.ToolStripMenuItem(); this.tsbCheckUpdateGeo = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateGeoIP = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.tsbHelp = new System.Windows.Forms.ToolStripDropDownButton(); this.tsbHelp = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbAbout = new System.Windows.Forms.ToolStripMenuItem(); this.tsbAbout = new System.Windows.Forms.ToolStripMenuItem();
@@ -148,9 +131,6 @@
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.gbMsgTitle.SuspendLayout();
this.cmsMsgBox.SuspendLayout();
this.ssMain.SuspendLayout();
this.cmsMain.SuspendLayout(); this.cmsMain.SuspendLayout();
this.tsMain.SuspendLayout(); this.tsMain.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@@ -228,7 +208,6 @@
this.menuExport2ShareUrl, this.menuExport2ShareUrl,
this.menuExport2SubContent}); this.menuExport2SubContent});
this.cmsLv.Name = "cmsLv"; this.cmsLv.Name = "cmsLv";
this.cmsLv.OwnerItem = this.tsbServer;
resources.ApplyResources(this.cmsLv, "cmsLv"); resources.ApplyResources(this.cmsLv, "cmsLv");
// //
// menuAddVmessServer // menuAddVmessServer
@@ -449,7 +428,7 @@
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
this.splitContainer1.Panel2.Controls.Add(this.gbMsgTitle); this.splitContainer1.Panel2.Controls.Add(this.mainMsgControl);
// //
// groupBox1 // groupBox1
// //
@@ -458,119 +437,10 @@
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
// gbMsgTitle // mainMsgControl
// //
this.gbMsgTitle.Controls.Add(this.txtMsgBox); resources.ApplyResources(this.mainMsgControl, "mainMsgControl");
this.gbMsgTitle.Controls.Add(this.ssMain); this.mainMsgControl.Name = "mainMsgControl";
resources.ApplyResources(this.gbMsgTitle, "gbMsgTitle");
this.gbMsgTitle.Name = "gbMsgTitle";
this.gbMsgTitle.TabStop = false;
//
// txtMsgBox
//
this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52)))));
this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtMsgBox.ContextMenuStrip = this.cmsMsgBox;
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
this.txtMsgBox.Name = "txtMsgBox";
this.txtMsgBox.ReadOnly = true;
this.txtMsgBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtMsgBox_KeyDown);
//
// cmsMsgBox
//
this.cmsMsgBox.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMsgBoxSelectAll,
this.menuMsgBoxCopy,
this.menuMsgBoxCopyAll,
this.menuMsgBoxClear,
this.menuMsgBoxAddRoutingRule,
this.menuMsgBoxFilter});
this.cmsMsgBox.Name = "cmsMsgBox";
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
//
// menuMsgBoxSelectAll
//
this.menuMsgBoxSelectAll.Name = "menuMsgBoxSelectAll";
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
this.menuMsgBoxSelectAll.Click += new System.EventHandler(this.menuMsgBoxSelectAll_Click);
//
// menuMsgBoxCopy
//
this.menuMsgBoxCopy.Name = "menuMsgBoxCopy";
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
this.menuMsgBoxCopy.Click += new System.EventHandler(this.menuMsgBoxCopy_Click);
//
// menuMsgBoxCopyAll
//
this.menuMsgBoxCopyAll.Name = "menuMsgBoxCopyAll";
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
this.menuMsgBoxCopyAll.Click += new System.EventHandler(this.menuMsgBoxCopyAll_Click);
//
// menuMsgBoxClear
//
this.menuMsgBoxClear.Name = "menuMsgBoxClear";
resources.ApplyResources(this.menuMsgBoxClear, "menuMsgBoxClear");
this.menuMsgBoxClear.Click += new System.EventHandler(this.menuMsgBoxClear_Click);
//
// menuMsgBoxAddRoutingRule
//
this.menuMsgBoxAddRoutingRule.Name = "menuMsgBoxAddRoutingRule";
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
this.menuMsgBoxAddRoutingRule.Click += new System.EventHandler(this.menuMsgBoxAddRoutingRule_Click);
//
// menuMsgBoxFilter
//
this.menuMsgBoxFilter.Name = "menuMsgBoxFilter";
resources.ApplyResources(this.menuMsgBoxFilter, "menuMsgBoxFilter");
this.menuMsgBoxFilter.Click += new System.EventHandler(this.menuMsgBoxFilter_Click);
//
// ssMain
//
this.ssMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolSslInboundInfo,
this.toolSslBlank1,
this.toolSslRoutingRule,
this.toolSslBlank2,
this.toolSslServerSpeed,
this.toolSslBlank4});
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.Name = "ssMain";
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
//
// toolSslInboundInfo
//
this.toolSslInboundInfo.Name = "toolSslInboundInfo";
resources.ApplyResources(this.toolSslInboundInfo, "toolSslInboundInfo");
//
// toolSslBlank1
//
resources.ApplyResources(this.toolSslBlank1, "toolSslBlank1");
this.toolSslBlank1.Name = "toolSslBlank1";
this.toolSslBlank1.Spring = true;
//
// toolSslRoutingRule
//
this.toolSslRoutingRule.Name = "toolSslRoutingRule";
resources.ApplyResources(this.toolSslRoutingRule, "toolSslRoutingRule");
//
// toolSslBlank2
//
this.toolSslBlank2.Name = "toolSslBlank2";
resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
this.toolSslBlank2.Spring = true;
//
// toolSslServerSpeed
//
resources.ApplyResources(this.toolSslServerSpeed, "toolSslServerSpeed");
this.toolSslServerSpeed.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolSslServerSpeed.Name = "toolSslServerSpeed";
//
// toolSslBlank4
//
this.toolSslBlank4.Name = "toolSslBlank4";
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
// //
// notifyMain // notifyMain
// //
@@ -586,7 +456,6 @@
this.menuSysAgentMode, this.menuSysAgentMode,
this.menuRoutings, this.menuRoutings,
this.menuServers, this.menuServers,
this.menuServers2,
this.toolStripSeparator13, this.toolStripSeparator13,
this.menuAddServers2, this.menuAddServers2,
this.menuScanScreen2, this.menuScanScreen2,
@@ -636,14 +505,6 @@
this.menuServers.Name = "menuServers"; this.menuServers.Name = "menuServers";
resources.ApplyResources(this.menuServers, "menuServers"); resources.ApplyResources(this.menuServers, "menuServers");
// //
// menuServers2
//
this.menuServers2.BackColor = System.Drawing.SystemColors.Window;
this.menuServers2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.menuServers2.DropDownWidth = 500;
resources.ApplyResources(this.menuServers2, "menuServers2");
this.menuServers2.Name = "menuServers2";
//
// toolStripSeparator13 // toolStripSeparator13
// //
this.toolStripSeparator13.Name = "toolStripSeparator13"; this.toolStripSeparator13.Name = "toolStripSeparator13";
@@ -831,8 +692,7 @@
this.tsbCheckUpdateCore, this.tsbCheckUpdateCore,
this.tsbCheckUpdateXrayCore, this.tsbCheckUpdateXrayCore,
this.toolStripSeparator15, this.toolStripSeparator15,
this.tsbCheckUpdateGeoSite, this.tsbCheckUpdateGeo});
this.tsbCheckUpdateGeoIP});
this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate; this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate;
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate"); resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
this.tsbCheckUpdate.Name = "tsbCheckUpdate"; this.tsbCheckUpdate.Name = "tsbCheckUpdate";
@@ -860,17 +720,11 @@
this.toolStripSeparator15.Name = "toolStripSeparator15"; this.toolStripSeparator15.Name = "toolStripSeparator15";
resources.ApplyResources(this.toolStripSeparator15, "toolStripSeparator15"); resources.ApplyResources(this.toolStripSeparator15, "toolStripSeparator15");
// //
// tsbCheckUpdateGeoSite // tsbCheckUpdateGeo
// //
this.tsbCheckUpdateGeoSite.Name = "tsbCheckUpdateGeoSite"; this.tsbCheckUpdateGeo.Name = "tsbCheckUpdateGeo";
resources.ApplyResources(this.tsbCheckUpdateGeoSite, "tsbCheckUpdateGeoSite"); resources.ApplyResources(this.tsbCheckUpdateGeo, "tsbCheckUpdateGeo");
this.tsbCheckUpdateGeoSite.Click += new System.EventHandler(this.tsbCheckUpdateGeoSite_Click); this.tsbCheckUpdateGeo.Click += new System.EventHandler(this.tsbCheckUpdateGeo_Click);
//
// tsbCheckUpdateGeoIP
//
this.tsbCheckUpdateGeoIP.Name = "tsbCheckUpdateGeoIP";
resources.ApplyResources(this.tsbCheckUpdateGeoIP, "tsbCheckUpdateGeoIP");
this.tsbCheckUpdateGeoIP.Click += new System.EventHandler(this.tsbCheckUpdateGeoIP_Click);
// //
// toolStripSeparator10 // toolStripSeparator10
// //
@@ -963,11 +817,6 @@
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false); this.splitContainer1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.gbMsgTitle.ResumeLayout(false);
this.gbMsgTitle.PerformLayout();
this.cmsMsgBox.ResumeLayout(false);
this.ssMain.ResumeLayout(false);
this.ssMain.PerformLayout();
this.cmsMain.ResumeLayout(false); this.cmsMain.ResumeLayout(false);
this.tsMain.ResumeLayout(false); this.tsMain.ResumeLayout(false);
this.tsMain.PerformLayout(); this.tsMain.PerformLayout();
@@ -979,8 +828,6 @@
#endregion #endregion
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox gbMsgTitle;
private System.Windows.Forms.TextBox txtMsgBox;
private v2rayN.Base.ListViewFlickerFree lvServers; private v2rayN.Base.ListViewFlickerFree lvServers;
private System.Windows.Forms.NotifyIcon notifyMain; private System.Windows.Forms.NotifyIcon notifyMain;
private System.Windows.Forms.ContextMenuStrip cmsMain; private System.Windows.Forms.ContextMenuStrip cmsMain;
@@ -1041,10 +888,6 @@
private System.Windows.Forms.ToolStripMenuItem tsbLanguageZhHans; private System.Windows.Forms.ToolStripMenuItem tsbLanguageZhHans;
private System.Windows.Forms.ToolStripButton tsbPromotion; private System.Windows.Forms.ToolStripButton tsbPromotion;
private System.Windows.Forms.ToolStripMenuItem menuAddSocksServer; private System.Windows.Forms.ToolStripMenuItem menuAddSocksServer;
private System.Windows.Forms.StatusStrip ssMain;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank1;
private System.Windows.Forms.ToolStripStatusLabel toolSslServerSpeed;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank4;
private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer; private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer;
private System.Windows.Forms.ToolStripMenuItem menuTcpingServer; private System.Windows.Forms.ToolStripMenuItem menuTcpingServer;
private System.Windows.Forms.ToolStripMenuItem menuRealPingServer; private System.Windows.Forms.ToolStripMenuItem menuRealPingServer;
@@ -1063,29 +906,18 @@
private System.Windows.Forms.ToolStripMenuItem menuClearServerStatistics; private System.Windows.Forms.ToolStripMenuItem menuClearServerStatistics;
private System.Windows.Forms.ToolStripMenuItem menuRoutings; private System.Windows.Forms.ToolStripMenuItem menuRoutings;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ContextMenuStrip cmsMsgBox;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopy;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxAddRoutingRule;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopyAll;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; private System.Windows.Forms.ToolStripSeparator toolStripSeparator14;
private System.Windows.Forms.ToolStripMenuItem tsbBackupGuiNConfig; private System.Windows.Forms.ToolStripMenuItem tsbBackupGuiNConfig;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; private System.Windows.Forms.ToolStripSeparator toolStripSeparator15;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateGeoSite; private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateGeo;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateGeoIP;
private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxFilter;
private System.Windows.Forms.ToolStripStatusLabel toolSslInboundInfo;
private System.Windows.Forms.ToolStripStatusLabel toolSslRoutingRule;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank2;
private System.Windows.Forms.ToolStripComboBox menuServers2;
private System.Windows.Forms.ToolStripMenuItem tsbSubUpdateViaProxy; private System.Windows.Forms.ToolStripMenuItem tsbSubUpdateViaProxy;
private System.Windows.Forms.ToolStripMenuItem menuUpdateSubViaProxy; private System.Windows.Forms.ToolStripMenuItem menuUpdateSubViaProxy;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxClear;
private System.Windows.Forms.ToolStripMenuItem tsbGlobalHotkeySetting; private System.Windows.Forms.ToolStripMenuItem tsbGlobalHotkeySetting;
private System.Windows.Forms.TabControl tabGroup; private System.Windows.Forms.TabControl tabGroup;
private System.Windows.Forms.ToolStripMenuItem tsbGroupSetting; private System.Windows.Forms.ToolStripMenuItem tsbGroupSetting;
private System.Windows.Forms.ToolStripMenuItem menuMoveToGroup; private System.Windows.Forms.ToolStripMenuItem menuMoveToGroup;
private MainMsgControl mainMsgControl;
} }
} }

View File

@@ -3,15 +3,14 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
using v2rayN.Tool; using v2rayN.Tool;
using System.Linq;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -20,7 +19,6 @@ namespace v2rayN.Forms
private V2rayHandler v2rayHandler; private V2rayHandler v2rayHandler;
private List<VmessItem> lstSelecteds = new List<VmessItem>(); private List<VmessItem> lstSelecteds = new List<VmessItem>();
private StatisticsHandler statistics = null; private StatisticsHandler statistics = null;
private string MsgFilter = string.Empty;
private List<VmessItem> lstVmess = null; private List<VmessItem> lstVmess = null;
private string groupId = string.Empty; private string groupId = string.Empty;
@@ -82,12 +80,12 @@ namespace v2rayN.Forms
RefreshRoutingsMenu(); RefreshRoutingsMenu();
RestoreUI(); RestoreUI();
_ = LoadV2ray();
HideForm(); HideForm();
MainFormHandler.Instance.UpdateTask(config, UpdateTaskHandler); MainFormHandler.Instance.UpdateTask(config, UpdateTaskHandler);
MainFormHandler.Instance.RegisterGlobalHotkey(config, OnHotkeyHandler, UpdateTaskHandler); MainFormHandler.Instance.RegisterGlobalHotkey(config, OnHotkeyHandler, UpdateTaskHandler);
_ = LoadV2ray();
} }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
@@ -149,12 +147,17 @@ namespace v2rayN.Forms
{ {
scMain.Panel2Collapsed = true; scMain.Panel2Collapsed = true;
if (!config.uiItem.mainLocation.IsEmpty)
{
this.Location = config.uiItem.mainLocation;
}
if (!config.uiItem.mainSize.IsEmpty) if (!config.uiItem.mainSize.IsEmpty)
{ {
this.Width = config.uiItem.mainSize.Width; this.Width = config.uiItem.mainSize.Width;
this.Height = config.uiItem.mainSize.Height; this.Height = config.uiItem.mainSize.Height;
} }
for (int k = 0; k < lvServers.Columns.Count; k++) for (int k = 0; k < lvServers.Columns.Count; k++)
{ {
var width = ConfigHandler.GetformMainLvColWidth(ref config, ((EServerColName)k).ToString(), lvServers.Columns[k].Width); var width = ConfigHandler.GetformMainLvColWidth(ref config, ((EServerColName)k).ToString(), lvServers.Columns[k].Width);
@@ -164,6 +167,8 @@ namespace v2rayN.Forms
private void StorageUI() private void StorageUI()
{ {
config.uiItem.mainLocation = this.Location;
config.uiItem.mainSize = new Size(this.Width, this.Height); config.uiItem.mainSize = new Size(this.Width, this.Height);
for (int k = 0; k < lvServers.Columns.Count; k++) for (int k = 0; k < lvServers.Columns.Count; k++)
@@ -228,22 +233,22 @@ namespace v2rayN.Forms
lvServers.RegisterDragEvent(UpdateDragEventHandler); lvServers.RegisterDragEvent(UpdateDragEventHandler);
lvServers.Columns.Add("", 30); lvServers.Columns.Add("", 30);
lvServers.Columns.Add(UIRes.I18N("LvServiceType"), 80); lvServers.Columns.Add(ResUI.LvServiceType, 80);
lvServers.Columns.Add(UIRes.I18N("LvAlias"), 100); lvServers.Columns.Add(ResUI.LvAlias, 100);
lvServers.Columns.Add(UIRes.I18N("LvAddress"), 120); lvServers.Columns.Add(ResUI.LvAddress, 120);
lvServers.Columns.Add(UIRes.I18N("LvPort"), 100); lvServers.Columns.Add(ResUI.LvPort, 100);
lvServers.Columns.Add(UIRes.I18N("LvEncryptionMethod"), 120); lvServers.Columns.Add(ResUI.LvEncryptionMethod, 120);
lvServers.Columns.Add(UIRes.I18N("LvTransportProtocol"), 120); lvServers.Columns.Add(ResUI.LvTransportProtocol, 120);
lvServers.Columns.Add(UIRes.I18N("LvTLS"), 100); lvServers.Columns.Add(ResUI.LvTLS, 100);
lvServers.Columns.Add(UIRes.I18N("LvSubscription"), 100); lvServers.Columns.Add(ResUI.LvSubscription, 100);
lvServers.Columns.Add(UIRes.I18N("LvTestResults"), 120, HorizontalAlignment.Right); lvServers.Columns.Add(ResUI.LvTestResults, 120, HorizontalAlignment.Right);
if (statistics != null && statistics.Enable) if (statistics != null && statistics.Enable)
{ {
lvServers.Columns.Add(UIRes.I18N("LvTodayDownloadDataAmount"), 70); lvServers.Columns.Add(ResUI.LvTodayDownloadDataAmount, 70);
lvServers.Columns.Add(UIRes.I18N("LvTodayUploadDataAmount"), 70); lvServers.Columns.Add(ResUI.LvTodayUploadDataAmount, 70);
lvServers.Columns.Add(UIRes.I18N("LvTotalDownloadDataAmount"), 70); lvServers.Columns.Add(ResUI.LvTotalDownloadDataAmount, 70);
lvServers.Columns.Add(UIRes.I18N("LvTotalUploadDataAmount"), 70); lvServers.Columns.Add(ResUI.LvTotalUploadDataAmount, 70);
} }
lvServers.EndUpdate(); lvServers.EndUpdate();
} }
@@ -265,7 +270,7 @@ namespace v2rayN.Forms
/// </summary> /// </summary>
private void RefreshServersView() private void RefreshServersView()
{ {
int index = lvServers.SelectedIndices.Count > 0 ? lvServers.SelectedIndices[0] : -1; int index = GetLvSelectedIndex(false);
lvServers.BeginUpdate(); lvServers.BeginUpdate();
lvServers.Items.Clear(); lvServers.Items.Clear();
@@ -273,29 +278,12 @@ namespace v2rayN.Forms
for (int k = 0; k < lstVmess.Count; k++) for (int k = 0; k < lstVmess.Count; k++)
{ {
string def = string.Empty; string def = string.Empty;
string totalUp = string.Empty,
totalDown = string.Empty,
todayUp = string.Empty,
todayDown = string.Empty;
VmessItem item = lstVmess[k]; VmessItem item = lstVmess[k];
if (config.IsActiveNode(item)) if (config.IsActiveNode(item))
{ {
def = "√"; def = "√";
} }
bool stats = statistics != null && statistics.Enable;
if (stats)
{
ServerStatItem sItem = statistics.Statistic.Find(item_ => item_.itemId == item.indexId);
if (sItem != null)
{
totalUp = Utils.HumanFy(sItem.totalUp);
totalDown = Utils.HumanFy(sItem.totalDown);
todayUp = Utils.HumanFy(sItem.todayUp);
todayDown = Utils.HumanFy(sItem.todayDown);
}
}
ListViewItem lvItem = new ListViewItem(def); ListViewItem lvItem = new ListViewItem(def);
Utils.AddSubItem(lvItem, EServerColName.configType.ToString(), (item.configType).ToString()); Utils.AddSubItem(lvItem, EServerColName.configType.ToString(), (item.configType).ToString());
Utils.AddSubItem(lvItem, EServerColName.remarks.ToString(), item.remarks); Utils.AddSubItem(lvItem, EServerColName.remarks.ToString(), item.remarks);
@@ -306,8 +294,22 @@ namespace v2rayN.Forms
Utils.AddSubItem(lvItem, EServerColName.streamSecurity.ToString(), item.streamSecurity); Utils.AddSubItem(lvItem, EServerColName.streamSecurity.ToString(), item.streamSecurity);
Utils.AddSubItem(lvItem, EServerColName.subRemarks.ToString(), item.GetSubRemarks(config)); Utils.AddSubItem(lvItem, EServerColName.subRemarks.ToString(), item.GetSubRemarks(config));
Utils.AddSubItem(lvItem, EServerColName.testResult.ToString(), item.testResult); Utils.AddSubItem(lvItem, EServerColName.testResult.ToString(), item.testResult);
if (stats)
if (statistics != null && statistics.Enable)
{ {
string totalUp = string.Empty,
totalDown = string.Empty,
todayUp = string.Empty,
todayDown = string.Empty;
ServerStatItem sItem = statistics.Statistic.Find(item_ => item_.itemId == item.indexId);
if (sItem != null)
{
totalUp = Utils.HumanFy(sItem.totalUp);
totalDown = Utils.HumanFy(sItem.totalDown);
todayUp = Utils.HumanFy(sItem.todayUp);
todayDown = Utils.HumanFy(sItem.todayDown);
}
Utils.AddSubItem(lvItem, EServerColName.todayDown.ToString(), todayDown); Utils.AddSubItem(lvItem, EServerColName.todayDown.ToString(), todayDown);
Utils.AddSubItem(lvItem, EServerColName.todayUp.ToString(), todayUp); Utils.AddSubItem(lvItem, EServerColName.todayUp.ToString(), todayUp);
Utils.AddSubItem(lvItem, EServerColName.totalDown.ToString(), totalDown); Utils.AddSubItem(lvItem, EServerColName.totalDown.ToString(), totalDown);
@@ -342,56 +344,32 @@ namespace v2rayN.Forms
private void RefreshServersMenu() private void RefreshServersMenu()
{ {
menuServers.DropDownItems.Clear(); menuServers.DropDownItems.Clear();
menuServers2.SelectedIndexChanged -= MenuServers2_SelectedIndexChanged;
menuServers2.Items.Clear();
menuServers.Visible = false;
menuServers2.Visible = false;
if (lstVmess.Count > 20) if (lstVmess.Count > 30)
{ {
for (int k = 0; k < lstVmess.Count; k++) menuServers.DropDownItems.Add(new ToolStripMenuItem(ResUI.TooManyServersTip));
{ return;
VmessItem item = lstVmess[k];
string name = item.GetSummary();
if (config.IsActiveNode(item))
{
name = $"√ {name}";
}
menuServers2.Items.Add(name);
}
menuServers2.SelectedIndex = lstVmess.FindIndex(it => it.indexId == config.indexId);
menuServers2.SelectedIndexChanged += MenuServers2_SelectedIndexChanged;
menuServers2.Visible = true;
} }
else
List<ToolStripMenuItem> lst = new List<ToolStripMenuItem>();
for (int k = 0; k < lstVmess.Count; k++)
{ {
List<ToolStripMenuItem> lst = new List<ToolStripMenuItem>(); VmessItem item = lstVmess[k];
for (int k = 0; k < lstVmess.Count; k++) string name = item.GetSummary();
ToolStripMenuItem ts = new ToolStripMenuItem(name)
{ {
VmessItem item = lstVmess[k]; Tag = k
string name = item.GetSummary(); };
if (config.IsActiveNode(item))
ToolStripMenuItem ts = new ToolStripMenuItem(name) {
{ ts.Checked = true;
Tag = k
};
if (config.IsActiveNode(item))
{
ts.Checked = true;
}
ts.Click += new EventHandler(ts_Click);
lst.Add(ts);
} }
menuServers.DropDownItems.AddRange(lst.ToArray()); ts.Click += new EventHandler(ts_Click);
menuServers.Visible = true; lst.Add(ts);
} }
} menuServers.DropDownItems.AddRange(lst.ToArray());
menuServers.Visible = true;
private void MenuServers2_SelectedIndexChanged(object sender, EventArgs e)
{
SetDefaultServer(((ToolStripComboBox)sender).SelectedIndex);
} }
private void ts_Click(object sender, EventArgs e) private void ts_Click(object sender, EventArgs e)
@@ -409,38 +387,8 @@ namespace v2rayN.Forms
private void lvServers_SelectedIndexChanged(object sender, EventArgs e) private void lvServers_SelectedIndexChanged(object sender, EventArgs e)
{ {
int index = -1;
try
{
if (lvServers.SelectedIndices.Count > 0)
{
index = lvServers.SelectedIndices[0];
}
}
catch
{
}
if (index < 0)
{
return;
}
//qrCodeControl.showQRCode(index, config);
} }
private void DisplayToolStatus()
{
toolSslInboundInfo.Text = $"{Global.InboundSocks} {Global.Loopback}:{config.inbound[0].localPort} | "
+ $"{ Global.InboundHttp} { Global.Loopback}:{Global.httpPort}";
notifyMain.Icon = MainFormHandler.Instance.GetNotifyIcon(config, this.Icon);
}
private void ssMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (!Utils.IsNullOrEmpty(e.ClickedItem.Text))
{
Utils.SetClipboardData(e.ClickedItem.Text);
}
}
private void lvServers_ColumnClick(object sender, ColumnClickEventArgs e) private void lvServers_ColumnClick(object sender, ColumnClickEventArgs e)
{ {
@@ -485,12 +433,12 @@ namespace v2rayN.Forms
{ {
tabGroup.TabPages.Clear(); tabGroup.TabPages.Clear();
string title = $" {UIRes.I18N("AllGroupServers")} "; string title = $" {ResUI.AllGroupServers} ";
var tabPage = new TabPage(title); var tabPage = new TabPage(title);
tabPage.Name = ""; tabPage.Name = "";
tabGroup.TabPages.Add(tabPage); tabGroup.TabPages.Add(tabPage);
foreach (var item in config.groupItem) foreach (var item in config.groupItem.OrderBy(t => t.sort))
{ {
var tabPage2 = new TabPage($" {item.remarks} "); var tabPage2 = new TabPage($" {item.remarks} ");
tabPage2.Name = item.id; tabPage2.Name = item.id;
@@ -557,17 +505,19 @@ namespace v2rayN.Forms
#endregion #endregion
#region v2ray #region v2ray
/// <summary> /// <summary>
/// 载入V2ray /// 载入V2ray
/// </summary> /// </summary>
async Task LoadV2ray() async Task LoadV2ray()
{ {
tsbReload.Enabled = false; this.BeginInvoke(new Action(() =>
{
tsbReload.Enabled = false;
}));
if (Global.reloadV2ray) if (Global.reloadV2ray)
{ {
ClearMsg(); mainMsgControl.ClearMsg();
} }
await Task.Run(() => await Task.Run(() =>
{ {
@@ -580,7 +530,10 @@ namespace v2rayN.Forms
ChangePACButtonStatus(config.sysProxyType); ChangePACButtonStatus(config.sysProxyType);
tsbReload.Enabled = true; this.BeginInvoke(new Action(() =>
{
tsbReload.Enabled = true;
}));
} }
/// <summary> /// <summary>
@@ -602,17 +555,7 @@ namespace v2rayN.Forms
private void lvServers_Click(object sender, EventArgs e) private void lvServers_Click(object sender, EventArgs e)
{ {
int index = -1; int index = GetLvSelectedIndex(false);
try
{
if (lvServers.SelectedIndices.Count > 0)
{
index = lvServers.SelectedIndices[0];
}
}
catch
{
}
if (index < 0) if (index < 0)
{ {
return; return;
@@ -727,7 +670,7 @@ namespace v2rayN.Forms
{ {
return; return;
} }
if (UI.ShowYesNo(UIRes.I18N("RemoveServer")) == DialogResult.No) if (UI.ShowYesNo(ResUI.RemoveServer) == DialogResult.No)
{ {
return; return;
} }
@@ -744,7 +687,7 @@ namespace v2rayN.Forms
int newCount = ConfigHandler.DedupServerList(ref config, ref lstVmess); int newCount = ConfigHandler.DedupServerList(ref config, ref lstVmess);
RefreshServers(); RefreshServers();
_ = LoadV2ray(); _ = LoadV2ray();
UI.Show(string.Format(UIRes.I18N("RemoveDuplicateServerResult"), oldCount, newCount)); UI.Show(string.Format(ResUI.RemoveDuplicateServerResult, oldCount, newCount));
} }
private void menuCopyServer_Click(object sender, EventArgs e) private void menuCopyServer_Click(object sender, EventArgs e)
@@ -784,11 +727,11 @@ namespace v2rayN.Forms
{ {
//if (!config.sysAgentEnabled) //if (!config.sysAgentEnabled)
//{ //{
// UI.Show(UIRes.I18N("NeedHttpGlobalProxy")); // UI.Show(ResUI.NeedHttpGlobalProxy"));
// return; // return;
//} //}
//UI.Show(UIRes.I18N("SpeedServerTips")); //UI.Show(ResUI.SpeedServerTips"));
Speedtest(ESpeedActionType.Realping); Speedtest(ESpeedActionType.Realping);
} }
@@ -797,11 +740,11 @@ namespace v2rayN.Forms
{ {
//if (!config.sysAgentEnabled) //if (!config.sysAgentEnabled)
//{ //{
// UI.Show(UIRes.I18N("NeedHttpGlobalProxy")); // UI.Show(ResUI.NeedHttpGlobalProxy"));
// return; // return;
//} //}
//UI.Show(UIRes.I18N("SpeedServerTips")); //UI.Show(ResUI.SpeedServerTips"));
Speedtest(ESpeedActionType.Speedtest); Speedtest(ESpeedActionType.Speedtest);
} }
@@ -809,14 +752,13 @@ namespace v2rayN.Forms
{ {
if (GetLvSelectedIndex() < 0) return; if (GetLvSelectedIndex() < 0) return;
ClearTestResult(); ClearTestResult();
SpeedtestHandler statistics = new SpeedtestHandler(ref config, v2rayHandler, lstSelecteds, actionType, UpdateSpeedtestHandler); SpeedtestHandler statistics = new SpeedtestHandler(config, v2rayHandler, lstSelecteds, actionType, UpdateSpeedtestHandler);
} }
private void tsbTestMe_Click(object sender, EventArgs e) private void tsbTestMe_Click(object sender, EventArgs e)
{ {
SpeedtestHandler statistics = new SpeedtestHandler(ref config); var updateHandle = new UpdateHandle();
string result = statistics.RunAvailabilityCheck() + "ms"; updateHandle.RunAvailabilityCheck(UpdateTaskHandler);
AppendText(false, string.Format(UIRes.I18N("TestMeOutput"), result));
} }
private void menuClearStatistic_Click(object sender, EventArgs e) private void menuClearStatistic_Click(object sender, EventArgs e)
@@ -857,8 +799,8 @@ namespace v2rayN.Forms
if (sb.Length > 0) if (sb.Length > 0)
{ {
Utils.SetClipboardData(sb.ToString()); Utils.SetClipboardData(sb.ToString());
AppendText(false, UIRes.I18N("BatchExportURLSuccessfully")); AppendText(false, ResUI.BatchExportURLSuccessfully);
//UI.Show(UIRes.I18N("BatchExportURLSuccessfully")); //UI.Show(ResUI.BatchExportURLSuccessfully"));
} }
} }
@@ -880,7 +822,7 @@ namespace v2rayN.Forms
if (sb.Length > 0) if (sb.Length > 0)
{ {
Utils.SetClipboardData(Utils.Base64Encode(sb.ToString())); Utils.SetClipboardData(Utils.Base64Encode(sb.ToString()));
UI.Show(UIRes.I18N("BatchExportSubscriptionSuccessfully")); UI.Show(ResUI.BatchExportSubscriptionSuccessfully);
} }
} }
@@ -910,9 +852,9 @@ namespace v2rayN.Forms
var fm = new GlobalHotkeySettingForm(); var fm = new GlobalHotkeySettingForm();
if (fm.ShowDialog() == DialogResult.OK) if (fm.ShowDialog() == DialogResult.OK)
{ {
RefreshRoutingsMenu(); //RefreshRoutingsMenu();
RefreshServers(); //RefreshServers();
_ = LoadV2ray(); //_ = LoadV2ray();
} }
} }
@@ -950,7 +892,7 @@ namespace v2rayN.Forms
{ {
if (index < 0) if (index < 0)
{ {
UI.Show(UIRes.I18N("PleaseSelectServer")); UI.Show(ResUI.PleaseSelectServer);
return -1; return -1;
} }
if (ConfigHandler.SetDefaultServer(ref config, lstVmess[index]) == 0) if (ConfigHandler.SetDefaultServer(ref config, lstVmess[index]) == 0)
@@ -965,7 +907,7 @@ namespace v2rayN.Forms
/// 取得ListView选中的行 /// 取得ListView选中的行
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
private int GetLvSelectedIndex() private int GetLvSelectedIndex(bool show = true)
{ {
int index = -1; int index = -1;
lstSelecteds.Clear(); lstSelecteds.Clear();
@@ -973,7 +915,10 @@ namespace v2rayN.Forms
{ {
if (lvServers.SelectedIndices.Count <= 0) if (lvServers.SelectedIndices.Count <= 0)
{ {
UI.Show(UIRes.I18N("PleaseSelectServer")); if (show)
{
UI.Show(ResUI.PleaseSelectServer);
}
return index; return index;
} }
@@ -1020,7 +965,7 @@ namespace v2rayN.Forms
if (ret > 0) if (ret > 0)
{ {
RefreshServers(); RefreshServers();
UI.Show(string.Format(UIRes.I18N("SuccessfullyImportedServerViaClipboard"), ret)); UI.Show(string.Format(ResUI.SuccessfullyImportedServerViaClipboard, ret));
} }
} }
@@ -1042,7 +987,7 @@ namespace v2rayN.Forms
if (Utils.IsNullOrEmpty(result)) if (Utils.IsNullOrEmpty(result))
{ {
UI.ShowWarning(UIRes.I18N("NoValidQRcodeFound")); UI.ShowWarning(ResUI.NoValidQRcodeFound);
} }
else else
{ {
@@ -1050,7 +995,7 @@ namespace v2rayN.Forms
if (ret > 0) if (ret > 0)
{ {
RefreshServers(); RefreshServers();
UI.Show(UIRes.I18N("SuccessfullyImportedServerViaScan")); UI.Show(ResUI.SuccessfullyImportedServerViaScan);
} }
} }
} }
@@ -1083,68 +1028,17 @@ namespace v2rayN.Forms
AppendText(notify, msg); AppendText(notify, msg);
} }
delegate void AppendTextDelegate(string text);
void AppendText(bool notify, string msg) void AppendText(bool notify, string msg)
{ {
try try
{ {
AppendText(msg); mainMsgControl.AppendText(msg);
if (notify) if (notify)
{ {
notifyMsg(msg); notifyMsg(msg);
} }
} }
catch catch { }
{
}
}
void AppendText(string text)
{
if (this.txtMsgBox.InvokeRequired)
{
Invoke(new AppendTextDelegate(AppendText), new object[] { text });
}
else
{
if (!Utils.IsNullOrEmpty(MsgFilter))
{
if (!Regex.IsMatch(text, MsgFilter))
{
return;
}
}
//this.txtMsgBox.AppendText(text);
ShowMsg(text);
}
}
/// <summary>
/// 提示信息
/// </summary>
/// <param name="msg"></param>
private void ShowMsg(string msg)
{
if (txtMsgBox.Lines.Length > 999)
{
ClearMsg();
}
this.txtMsgBox.AppendText(msg);
if (!msg.EndsWith(Environment.NewLine))
{
this.txtMsgBox.AppendText(Environment.NewLine);
}
}
/// <summary>
/// 清除信息
/// </summary>
private void ClearMsg()
{
txtMsgBox.Invoke((Action)delegate
{
txtMsgBox.Clear();
});
} }
/// <summary> /// <summary>
@@ -1188,12 +1082,14 @@ namespace v2rayN.Forms
this.Activate(); this.Activate();
this.ShowInTaskbar = true; this.ShowInTaskbar = true;
//this.notifyIcon1.Visible = false; //this.notifyIcon1.Visible = false;
this.txtMsgBox.ScrollToCaret(); mainMsgControl.ScrollToCaret();
//if (config.index >= 0 && config.index < lvServers.Items.Count)
//{ int index = GetLvSelectedIndex(false);
// lvServers.Items[config.index].Selected = true; if (index >= 0 && index < lvServers.Items.Count && lvServers.Items.Count > 0)
// lvServers.EnsureVisible(config.index); // workaround {
//} lvServers.Items[index].Selected = true;
lvServers.EnsureVisible(index); // workaround
}
SetVisibleCore(true); SetVisibleCore(true);
} }
@@ -1220,6 +1116,10 @@ namespace v2rayN.Forms
lstVmess[k].testResult = txt; lstVmess[k].testResult = txt;
lvServers.Items[k].SubItems["testResult"].Text = txt; lvServers.Items[k].SubItems["testResult"].Text = txt;
} }
else
{
AppendText(false, txt);
}
} }
private void SetTestResult(int k, string txt) private void SetTestResult(int k, string txt)
{ {
@@ -1250,27 +1150,28 @@ namespace v2rayN.Forms
{ {
up /= (ulong)(config.statisticsFreshRate / 1000f); up /= (ulong)(config.statisticsFreshRate / 1000f);
down /= (ulong)(config.statisticsFreshRate / 1000f); down /= (ulong)(config.statisticsFreshRate / 1000f);
toolSslServerSpeed.Text = string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down)); mainMsgControl.SetToolSslInfo("speed", string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down)));
List<string[]> datas = new List<string[]>(); foreach (var it in statistics)
for (int i = 0; i < lstVmess.Count; i++)
{ {
int index = statistics.FindIndex(item_ => item_.itemId == lstVmess[i].indexId); int index = lstVmess.FindIndex(item => item.indexId == it.itemId);
if (index != -1) if (index < 0)
{ {
lvServers.Invoke((MethodInvoker)delegate continue;
{
lvServers.BeginUpdate();
lvServers.Items[i].SubItems["todayDown"].Text = Utils.HumanFy(statistics[index].todayDown);
lvServers.Items[i].SubItems["todayUp"].Text = Utils.HumanFy(statistics[index].todayUp);
lvServers.Items[i].SubItems["totalDown"].Text = Utils.HumanFy(statistics[index].totalDown);
lvServers.Items[i].SubItems["totalUp"].Text = Utils.HumanFy(statistics[index].totalUp);
lvServers.EndUpdate();
});
} }
lvServers.Invoke((MethodInvoker)delegate
{
lvServers.BeginUpdate();
lvServers.Items[index].SubItems["todayDown"].Text = Utils.HumanFy(it.todayDown);
lvServers.Items[index].SubItems["todayUp"].Text = Utils.HumanFy(it.todayUp);
lvServers.Items[index].SubItems["totalDown"].Text = Utils.HumanFy(it.totalDown);
lvServers.Items[index].SubItems["totalUp"].Text = Utils.HumanFy(it.totalUp);
lvServers.EndUpdate();
});
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -1278,13 +1179,13 @@ namespace v2rayN.Forms
} }
} }
private void UpdateTaskHandler(bool success, string msg) private async void UpdateTaskHandler(bool success, string msg)
{ {
AppendText(false, msg); AppendText(false, msg);
if (success) if (success)
{ {
Global.reloadV2ray = true; Global.reloadV2ray = true;
_ = LoadV2ray(); await LoadV2ray();
} }
} }
#endregion #endregion
@@ -1316,7 +1217,7 @@ namespace v2rayN.Forms
int index = GetLvSelectedIndex(); int index = GetLvSelectedIndex();
if (index < 0) if (index < 0)
{ {
UI.Show(UIRes.I18N("PleaseSelectServer")); UI.Show(ResUI.PleaseSelectServer);
return; return;
} }
if (ConfigHandler.MoveServer(ref config, ref lstVmess, index, eMove) == 0) if (ConfigHandler.MoveServer(ref config, ref lstVmess, index, eMove) == 0)
@@ -1369,7 +1270,10 @@ namespace v2rayN.Forms
} }
ConfigHandler.SaveConfig(ref config, false); ConfigHandler.SaveConfig(ref config, false);
DisplayToolStatus();
mainMsgControl.DisplayToolStatus(config);
notifyMain.Icon = MainFormHandler.Instance.GetNotifyIcon(config, this.Icon);
} }
#endregion #endregion
@@ -1387,7 +1291,10 @@ namespace v2rayN.Forms
menuExit_Click(null, null); menuExit_Click(null, null);
} }
}; };
(new UpdateHandle()).CheckUpdateGuiN(config, _updateUI); Task.Run(() =>
{
(new UpdateHandle()).CheckUpdateGuiN(config, _updateUI);
});
} }
private void tsbCheckUpdateCore_Click(object sender, EventArgs e) private void tsbCheckUpdateCore_Click(object sender, EventArgs e)
@@ -1412,42 +1319,30 @@ namespace v2rayN.Forms
string fileName = Utils.GetPath(Utils.GetDownloadFileName(msg)); string fileName = Utils.GetPath(Utils.GetDownloadFileName(msg));
FileManager.ZipExtractToFile(fileName, config.ignoreGeoUpdateCore ? "geo" : ""); FileManager.ZipExtractToFile(fileName, config.ignoreGeoUpdateCore ? "geo" : "");
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfullyMore")); AppendText(false, ResUI.MsgUpdateV2rayCoreSuccessfullyMore);
Global.reloadV2ray = true; Global.reloadV2ray = true;
_ = LoadV2ray(); _ = LoadV2ray();
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfully")); AppendText(false, ResUI.MsgUpdateV2rayCoreSuccessfully);
} }
}; };
(new UpdateHandle()).CheckUpdateCore(type, config, _updateUI); Task.Run(() =>
}
private void tsbCheckUpdateGeoSite_Click(object sender, EventArgs e)
{
(new UpdateHandle()).UpdateGeoFile("geosite", config, (bool success, string msg) =>
{ {
AppendText(false, msg); (new UpdateHandle()).CheckUpdateCore(type, config, _updateUI);
if (success)
{
Global.reloadV2ray = true;
_ = LoadV2ray();
}
}); });
} }
private void tsbCheckUpdateGeoIP_Click(object sender, EventArgs e) private void tsbCheckUpdateGeo_Click(object sender, EventArgs e)
{ {
(new UpdateHandle()).UpdateGeoFile("geoip", config, (bool success, string msg) => Task.Run(() =>
{ {
AppendText(false, msg); var updateHandle = new UpdateHandle();
if (success) updateHandle.UpdateGeoFile("geosite", config, UpdateTaskHandler);
{ updateHandle.UpdateGeoFile("geoip", config, UpdateTaskHandler);
Global.reloadV2ray = true;
_ = LoadV2ray();
}
}); });
} }
#endregion #endregion
#region Help #region Help
@@ -1537,10 +1432,6 @@ namespace v2rayN.Forms
//Application.Restart(); //Application.Restart();
} }
#endregion #endregion
@@ -1554,7 +1445,7 @@ namespace v2rayN.Forms
menuRoutings.Visible = config.enableRoutingAdvanced; menuRoutings.Visible = config.enableRoutingAdvanced;
if (!config.enableRoutingAdvanced) if (!config.enableRoutingAdvanced)
{ {
toolSslRoutingRule.Text = string.Empty; mainMsgControl.SetToolSslInfo("routing", string.Empty);
return; return;
} }
@@ -1577,7 +1468,7 @@ namespace v2rayN.Forms
if (config.routingIndex.Equals(k)) if (config.routingIndex.Equals(k))
{ {
ts.Checked = true; ts.Checked = true;
toolSslRoutingRule.Text = item.remarks; mainMsgControl.SetToolSslInfo("routing", item.remarks);
} }
ts.Click += new EventHandler(ts_Routing_Click); ts.Click += new EventHandler(ts_Routing_Click);
lst.Add(ts); lst.Add(ts);
@@ -1603,66 +1494,5 @@ namespace v2rayN.Forms
} }
} }
#endregion #endregion
#region MsgBoxMenu
private void menuMsgBoxSelectAll_Click(object sender, EventArgs e)
{
this.txtMsgBox.Focus();
this.txtMsgBox.SelectAll();
}
private void menuMsgBoxCopy_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.SelectedText.TrimEx();
Utils.SetClipboardData(data);
}
private void menuMsgBoxCopyAll_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.Text;
Utils.SetClipboardData(data);
}
private void menuMsgBoxClear_Click(object sender, EventArgs e)
{
this.txtMsgBox.Clear();
}
private void menuMsgBoxAddRoutingRule_Click(object sender, EventArgs e)
{
menuMsgBoxCopy_Click(null, null);
tsbRoutingSetting_Click(null, null);
}
private void txtMsgBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
switch (e.KeyCode)
{
case Keys.A:
menuMsgBoxSelectAll_Click(null, null);
break;
case Keys.C:
menuMsgBoxCopy_Click(null, null);
break;
case Keys.V:
menuMsgBoxAddRoutingRule_Click(null, null);
break;
}
}
}
private void menuMsgBoxFilter_Click(object sender, EventArgs e)
{
var fm = new MsgFilterSetForm();
fm.MsgFilter = MsgFilter;
if (fm.ShowDialog() == DialogResult.OK)
{
MsgFilter = fm.MsgFilter;
gbMsgTitle.Text = string.Format(UIRes.I18N("MsgInformationTitle"), MsgFilter);
}
}
#endregion
} }
} }

View File

@@ -126,7 +126,7 @@
<value>3, 17</value> <value>3, 17</value>
</data> </data>
<metadata name="cmsLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="cmsLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>327, 17</value> <value>226, 19</value>
</metadata> </metadata>
<data name="menuAddVmessServer.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuAddVmessServer.Size" type="System.Drawing.Size, System.Drawing">
<value>355, 22</value> <value>355, 22</value>
@@ -308,18 +308,6 @@
<data name="menuExport2SubContent.Text" xml:space="preserve"> <data name="menuExport2SubContent.Text" xml:space="preserve">
<value>Export subscription (base64) share to clipboard</value> <value>Export subscription (base64) share to clipboard</value>
</data> </data>
<data name="tsbServer.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 53</value>
</data>
<data name="tsbServer.Text" xml:space="preserve">
<value>Servers</value>
</data>
<data name="tsbServer.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>ImageAboveText</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing"> <data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>356, 666</value> <value>356, 666</value>
</data> </data>
@@ -470,6 +458,18 @@
<data name="&gt;&gt;scMain.ZOrder" xml:space="preserve"> <data name="&gt;&gt;scMain.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="tsbServer.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 53</value>
</data>
<data name="tsbServer.Text" xml:space="preserve">
<value>Servers</value>
</data>
<data name="tsbServer.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>ImageAboveText</value>
</data>
<data name="splitContainer1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="splitContainer1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value> <value>Fill</value>
</data> </data>
@@ -515,178 +515,28 @@
<data name="&gt;&gt;splitContainer1.Panel1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;splitContainer1.Panel1.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<metadata name="cmsMsgBox.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <data name="mainMsgControl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>493, 20</value>
</metadata>
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="menuMsgBoxSelectAll.Text" xml:space="preserve">
<value>Select All (Ctrl+A)</value>
</data>
<data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="menuMsgBoxCopy.Text" xml:space="preserve">
<value>Copy (Ctrl+C)</value>
</data>
<data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="menuMsgBoxCopyAll.Text" xml:space="preserve">
<value>Copy All</value>
</data>
<data name="menuMsgBoxClear.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="menuMsgBoxClear.Text" xml:space="preserve">
<value>Clear All</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
<value>Add Routing Rule (Ctrl+V)</value>
</data>
<data name="menuMsgBoxFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="menuMsgBoxFilter.Text" xml:space="preserve">
<value>Set message filters</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>228, 136</value>
</data>
<data name="&gt;&gt;cmsMsgBox.Name" xml:space="preserve">
<value>cmsMsgBox</value>
</data>
<data name="&gt;&gt;cmsMsgBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtMsgBox.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value> <value>Fill</value>
</data> </data>
<data name="txtMsgBox.Location" type="System.Drawing.Point, System.Drawing"> <data name="mainMsgControl.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtMsgBox.MaxLength" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="txtMsgBox.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtMsgBox.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="txtMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>946, 177</value>
</data>
<data name="txtMsgBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;txtMsgBox.Name" xml:space="preserve">
<value>txtMsgBox</value>
</data>
<data name="&gt;&gt;txtMsgBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtMsgBox.Parent" xml:space="preserve">
<value>gbMsgTitle</value>
</data>
<data name="&gt;&gt;txtMsgBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>228, 18</value>
</metadata>
<data name="toolSslInboundInfo.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="toolSslInboundInfo.Text" xml:space="preserve">
<value>InboundInfo</value>
</data>
<data name="toolSslBlank1.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 21</value>
</data>
<data name="toolSslRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 21</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 21</value>
</data>
<data name="toolSslServerSpeed.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="toolSslServerSpeed.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslServerSpeed.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>No</value>
</data>
<data name="toolSslServerSpeed.Size" type="System.Drawing.Size, System.Drawing">
<value>250, 21</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>SPEED Disabled</value>
</data>
<data name="toolSslServerSpeed.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleRight</value>
</data>
<data name="toolSslBlank4.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 21</value>
</data>
<data name="ssMain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 194</value>
</data>
<data name="ssMain.Size" type="System.Drawing.Size, System.Drawing">
<value>946, 26</value>
</data>
<data name="ssMain.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="ssMain.Text" xml:space="preserve">
<value>statusStrip1</value>
</data>
<data name="&gt;&gt;ssMain.Name" xml:space="preserve">
<value>ssMain</value>
</data>
<data name="&gt;&gt;ssMain.Type" xml:space="preserve">
<value>System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;ssMain.Parent" xml:space="preserve">
<value>gbMsgTitle</value>
</data>
<data name="&gt;&gt;ssMain.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="gbMsgTitle.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="gbMsgTitle.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value> <value>0, 0</value>
</data> </data>
<data name="gbMsgTitle.Size" type="System.Drawing.Size, System.Drawing"> <data name="mainMsgControl.Size" type="System.Drawing.Size, System.Drawing">
<value>952, 223</value> <value>952, 223</value>
</data> </data>
<data name="gbMsgTitle.TabIndex" type="System.Int32, mscorlib"> <data name="mainMsgControl.TabIndex" type="System.Int32, mscorlib">
<value>3</value> <value>0</value>
</data> </data>
<data name="gbMsgTitle.Text" xml:space="preserve"> <data name="&gt;&gt;mainMsgControl.Name" xml:space="preserve">
<value>Informations</value> <value>mainMsgControl</value>
</data> </data>
<data name="&gt;&gt;gbMsgTitle.Name" xml:space="preserve"> <data name="&gt;&gt;mainMsgControl.Type" xml:space="preserve">
<value>gbMsgTitle</value> <value>v2rayN.Forms.MainMsgControl, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;gbMsgTitle.Type" xml:space="preserve"> <data name="&gt;&gt;mainMsgControl.Parent" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;gbMsgTitle.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value> <value>splitContainer1.Panel2</value>
</data> </data>
<data name="&gt;&gt;gbMsgTitle.ZOrder" xml:space="preserve"> <data name="&gt;&gt;mainMsgControl.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="&gt;&gt;splitContainer1.Panel2.Name" xml:space="preserve"> <data name="&gt;&gt;splitContainer1.Panel2.Name" xml:space="preserve">
@@ -720,7 +570,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;splitContainer1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;splitContainer1.ZOrder" xml:space="preserve">
<value>3</value> <value>2</value>
</data> </data>
<metadata name="notifyMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="notifyMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
@@ -750,73 +600,61 @@
<value>Do not change system proxy</value> <value>Do not change system proxy</value>
</data> </data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value> <value>277, 22</value>
</data> </data>
<data name="menuSysAgentMode.Text" xml:space="preserve"> <data name="menuSysAgentMode.Text" xml:space="preserve">
<value>System proxy</value> <value>System proxy</value>
</data> </data>
<data name="menuRoutings.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value> <value>277, 22</value>
</data> </data>
<data name="menuRoutings.Text" xml:space="preserve"> <data name="menuRoutings.Text" xml:space="preserve">
<value>Routing</value> <value>Routing</value>
</data> </data>
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value> <value>277, 22</value>
</data> </data>
<data name="menuServers.Text" xml:space="preserve"> <data name="menuServers.Text" xml:space="preserve">
<value>Server</value> <value>Server</value>
</data> </data>
<data name="menuServers2.FlatStyle" type="System.Windows.Forms.FlatStyle, System.Windows.Forms">
<value>Standard</value>
</data>
<data name="menuServers2.MaxDropDownItems" type="System.Int32, mscorlib">
<value>50</value>
</data>
<data name="menuServers2.Size" type="System.Drawing.Size, System.Drawing">
<value>200, 25</value>
</data>
<data name="menuServers2.ToolTipText" xml:space="preserve">
<value>Server</value>
</data>
<data name="toolStripSeparator13.Size" type="System.Drawing.Size, System.Drawing"> <data name="toolStripSeparator13.Size" type="System.Drawing.Size, System.Drawing">
<value>261, 6</value> <value>274, 6</value>
</data> </data>
<data name="menuAddServers2.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuAddServers2.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value> <value>277, 22</value>
</data> </data>
<data name="menuAddServers2.Text" xml:space="preserve"> <data name="menuAddServers2.Text" xml:space="preserve">
<value>Import bulk URL from clipboard</value> <value>Import bulk URL from clipboard</value>
</data> </data>
<data name="menuScanScreen2.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuScanScreen2.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value> <value>277, 22</value>
</data> </data>
<data name="menuScanScreen2.Text" xml:space="preserve"> <data name="menuScanScreen2.Text" xml:space="preserve">
<value>Scan QR code on the screen</value> <value>Scan QR code on the screen</value>
</data> </data>
<data name="menuUpdateSubscriptions.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuUpdateSubscriptions.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value> <value>277, 22</value>
</data> </data>
<data name="menuUpdateSubscriptions.Text" xml:space="preserve"> <data name="menuUpdateSubscriptions.Text" xml:space="preserve">
<value>Update subscriptions</value> <value>Update subscription without proxy</value>
</data> </data>
<data name="menuUpdateSubViaProxy.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuUpdateSubViaProxy.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value> <value>277, 22</value>
</data> </data>
<data name="menuUpdateSubViaProxy.Text" xml:space="preserve"> <data name="menuUpdateSubViaProxy.Text" xml:space="preserve">
<value>Update subscriptions via proxy</value> <value>Update subscriptions via proxy</value>
</data> </data>
<data name="toolStripSeparator2.Size" type="System.Drawing.Size, System.Drawing"> <data name="toolStripSeparator2.Size" type="System.Drawing.Size, System.Drawing">
<value>261, 6</value> <value>274, 6</value>
</data> </data>
<data name="menuExit.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuExit.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value> <value>277, 22</value>
</data> </data>
<data name="menuExit.Text" xml:space="preserve"> <data name="menuExit.Text" xml:space="preserve">
<value>Exit</value> <value>Exit</value>
</data> </data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing"> <data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>265, 221</value> <value>278, 192</value>
</data> </data>
<data name="&gt;&gt;cmsMain.Name" xml:space="preserve"> <data name="&gt;&gt;cmsMain.Name" xml:space="preserve">
<value>cmsMain</value> <value>cmsMain</value>
@@ -852,31 +690,31 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>4</value> <value>3</value>
</data> </data>
<metadata name="tsMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="tsMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>409, 17</value> <value>315, 17</value>
</metadata> </metadata>
<data name="toolStripSeparator4.Size" type="System.Drawing.Size, System.Drawing"> <data name="toolStripSeparator4.Size" type="System.Drawing.Size, System.Drawing">
<value>6, 56</value> <value>6, 56</value>
</data> </data>
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing"> <data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 22</value> <value>277, 22</value>
</data> </data>
<data name="tsbSubSetting.Text" xml:space="preserve"> <data name="tsbSubSetting.Text" xml:space="preserve">
<value>Settings</value> <value>Settings</value>
</data> </data>
<data name="tsbSubUpdate.Size" type="System.Drawing.Size, System.Drawing"> <data name="tsbSubUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 22</value> <value>277, 22</value>
</data> </data>
<data name="tsbSubUpdate.Text" xml:space="preserve"> <data name="tsbSubUpdate.Text" xml:space="preserve">
<value>Updates</value> <value>Update subscription without proxy</value>
</data> </data>
<data name="tsbSubUpdateViaProxy.Size" type="System.Drawing.Size, System.Drawing"> <data name="tsbSubUpdateViaProxy.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 22</value> <value>277, 22</value>
</data> </data>
<data name="tsbSubUpdateViaProxy.Text" xml:space="preserve"> <data name="tsbSubUpdateViaProxy.Text" xml:space="preserve">
<value>Updates via proxy</value> <value>Update subscription with proxy</value>
</data> </data>
<data name="tsbSub.ImageTransparentColor" type="System.Drawing.Color, System.Drawing"> <data name="tsbSub.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value> <value>Magenta</value>
@@ -995,17 +833,11 @@
<data name="toolStripSeparator15.Size" type="System.Drawing.Size, System.Drawing"> <data name="toolStripSeparator15.Size" type="System.Drawing.Size, System.Drawing">
<value>200, 6</value> <value>200, 6</value>
</data> </data>
<data name="tsbCheckUpdateGeoSite.Size" type="System.Drawing.Size, System.Drawing"> <data name="tsbCheckUpdateGeo.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 22</value> <value>203, 22</value>
</data> </data>
<data name="tsbCheckUpdateGeoSite.Text" xml:space="preserve"> <data name="tsbCheckUpdateGeo.Text" xml:space="preserve">
<value>Update GeoSite</value> <value>Update Geo files</value>
</data>
<data name="tsbCheckUpdateGeoIP.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 22</value>
</data>
<data name="tsbCheckUpdateGeoIP.Text" xml:space="preserve">
<value>Update GeoIP</value>
</data> </data>
<data name="tsbCheckUpdate.ImageTransparentColor" type="System.Drawing.Color, System.Drawing"> <data name="tsbCheckUpdate.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value> <value>Magenta</value>
@@ -1107,7 +939,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;tsMain.ZOrder" xml:space="preserve"> <data name="&gt;&gt;tsMain.ZOrder" xml:space="preserve">
<value>5</value> <value>4</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
@@ -1325,78 +1157,6 @@
<data name="&gt;&gt;tsbServer.Type" xml:space="preserve"> <data name="&gt;&gt;tsbServer.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;menuMsgBoxSelectAll.Name" xml:space="preserve">
<value>menuMsgBoxSelectAll</value>
</data>
<data name="&gt;&gt;menuMsgBoxSelectAll.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopy.Name" xml:space="preserve">
<value>menuMsgBoxCopy</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopy.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopyAll.Name" xml:space="preserve">
<value>menuMsgBoxCopyAll</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopyAll.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxClear.Name" xml:space="preserve">
<value>menuMsgBoxClear</value>
</data>
<data name="&gt;&gt;menuMsgBoxClear.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxAddRoutingRule.Name" xml:space="preserve">
<value>menuMsgBoxAddRoutingRule</value>
</data>
<data name="&gt;&gt;menuMsgBoxAddRoutingRule.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxFilter.Name" xml:space="preserve">
<value>menuMsgBoxFilter</value>
</data>
<data name="&gt;&gt;menuMsgBoxFilter.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslInboundInfo.Name" xml:space="preserve">
<value>toolSslInboundInfo</value>
</data>
<data name="&gt;&gt;toolSslInboundInfo.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslBlank1.Name" xml:space="preserve">
<value>toolSslBlank1</value>
</data>
<data name="&gt;&gt;toolSslBlank1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslRoutingRule.Name" xml:space="preserve">
<value>toolSslRoutingRule</value>
</data>
<data name="&gt;&gt;toolSslRoutingRule.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslBlank2.Name" xml:space="preserve">
<value>toolSslBlank2</value>
</data>
<data name="&gt;&gt;toolSslBlank2.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslServerSpeed.Name" xml:space="preserve">
<value>toolSslServerSpeed</value>
</data>
<data name="&gt;&gt;toolSslServerSpeed.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslBlank4.Name" xml:space="preserve">
<value>toolSslBlank4</value>
</data>
<data name="&gt;&gt;toolSslBlank4.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;notifyMain.Name" xml:space="preserve"> <data name="&gt;&gt;notifyMain.Name" xml:space="preserve">
<value>notifyMain</value> <value>notifyMain</value>
</data> </data>
@@ -1439,12 +1199,6 @@
<data name="&gt;&gt;menuServers.Type" xml:space="preserve"> <data name="&gt;&gt;menuServers.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;menuServers2.Name" xml:space="preserve">
<value>menuServers2</value>
</data>
<data name="&gt;&gt;menuServers2.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripSeparator13.Name" xml:space="preserve"> <data name="&gt;&gt;toolStripSeparator13.Name" xml:space="preserve">
<value>toolStripSeparator13</value> <value>toolStripSeparator13</value>
</data> </data>
@@ -1619,16 +1373,10 @@
<data name="&gt;&gt;toolStripSeparator15.Type" xml:space="preserve"> <data name="&gt;&gt;toolStripSeparator15.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;tsbCheckUpdateGeoSite.Name" xml:space="preserve"> <data name="&gt;&gt;tsbCheckUpdateGeo.Name" xml:space="preserve">
<value>tsbCheckUpdateGeoSite</value> <value>tsbCheckUpdateGeo</value>
</data> </data>
<data name="&gt;&gt;tsbCheckUpdateGeoSite.Type" xml:space="preserve"> <data name="&gt;&gt;tsbCheckUpdateGeo.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsbCheckUpdateGeoIP.Name" xml:space="preserve">
<value>tsbCheckUpdateGeoIP</value>
</data>
<data name="&gt;&gt;tsbCheckUpdateGeoIP.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;toolStripSeparator10.Name" xml:space="preserve"> <data name="&gt;&gt;toolStripSeparator10.Name" xml:space="preserve">

View File

@@ -321,48 +321,27 @@
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxCopy.Text" xml:space="preserve">
<value>复制 (Ctrl+C)</value>
</data>
<data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxCopyAll.Text" xml:space="preserve">
<value>复制所有</value>
</data>
<data name="menuMsgBoxClear.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxClear.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxClear.Text" xml:space="preserve">
<value>清除所有</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
<value>快速添加路由规则 (Ctrl+V)</value>
</data>
<data name="menuMsgBoxFilter.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuMsgBoxFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value> <value>221, 22</value>
</data> </data>
<data name="menuMsgBoxFilter.Text" xml:space="preserve">
<value>设置信息过滤器</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing"> <data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 136</value> <value>222, 136</value>
</data> </data>
<data name="toolSslServerSpeed.Text" xml:space="preserve"> <data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value> <value>网速显示未启用</value>
</data> </data>
<data name="gbMsgTitle.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 22</value> <value>172, 22</value>
</data> </data>
@@ -421,7 +400,7 @@
<value>260, 22</value> <value>260, 22</value>
</data> </data>
<data name="menuUpdateSubscriptions.Text" xml:space="preserve"> <data name="menuUpdateSubscriptions.Text" xml:space="preserve">
<value>更新订阅</value> <value>更新订阅(不通过代理)</value>
</data> </data>
<data name="menuUpdateSubViaProxy.Size" type="System.Drawing.Size, System.Drawing"> <data name="menuUpdateSubViaProxy.Size" type="System.Drawing.Size, System.Drawing">
<value>260, 22</value> <value>260, 22</value>
@@ -451,7 +430,7 @@
<value>180, 22</value> <value>180, 22</value>
</data> </data>
<data name="tsbSubUpdate.Text" xml:space="preserve"> <data name="tsbSubUpdate.Text" xml:space="preserve">
<value>更新订阅</value> <value>更新订阅(不通过代理)</value>
</data> </data>
<data name="tsbSubUpdateViaProxy.Size" type="System.Drawing.Size, System.Drawing"> <data name="tsbSubUpdateViaProxy.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value> <value>180, 22</value>

View File

@@ -0,0 +1,203 @@

namespace v2rayN.Forms
{
partial class MainMsgControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainMsgControl));
this.txtMsgBox = new System.Windows.Forms.TextBox();
this.cmsMsgBox = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuMsgBoxSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopy = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopyAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxClear = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxAddRoutingRule = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxFilter = new System.Windows.Forms.ToolStripMenuItem();
this.gbMsgTitle = new System.Windows.Forms.GroupBox();
this.ssMain = new System.Windows.Forms.StatusStrip();
this.toolSslInboundInfo = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslRoutingRule = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslServerSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank4 = new System.Windows.Forms.ToolStripStatusLabel();
this.cmsMsgBox.SuspendLayout();
this.gbMsgTitle.SuspendLayout();
this.ssMain.SuspendLayout();
this.SuspendLayout();
//
// txtMsgBox
//
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52)))));
this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtMsgBox.ContextMenuStrip = this.cmsMsgBox;
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
this.txtMsgBox.Name = "txtMsgBox";
this.txtMsgBox.ReadOnly = true;
//
// cmsMsgBox
//
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
this.cmsMsgBox.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMsgBoxSelectAll,
this.menuMsgBoxCopy,
this.menuMsgBoxCopyAll,
this.menuMsgBoxClear,
this.menuMsgBoxAddRoutingRule,
this.menuMsgBoxFilter});
this.cmsMsgBox.Name = "cmsMsgBox";
//
// menuMsgBoxSelectAll
//
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
this.menuMsgBoxSelectAll.Name = "menuMsgBoxSelectAll";
this.menuMsgBoxSelectAll.Click += new System.EventHandler(this.menuMsgBoxSelectAll_Click);
//
// menuMsgBoxCopy
//
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
this.menuMsgBoxCopy.Name = "menuMsgBoxCopy";
this.menuMsgBoxCopy.Click += new System.EventHandler(this.menuMsgBoxCopy_Click);
//
// menuMsgBoxCopyAll
//
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
this.menuMsgBoxCopyAll.Name = "menuMsgBoxCopyAll";
this.menuMsgBoxCopyAll.Click += new System.EventHandler(this.menuMsgBoxCopyAll_Click);
//
// menuMsgBoxClear
//
resources.ApplyResources(this.menuMsgBoxClear, "menuMsgBoxClear");
this.menuMsgBoxClear.Name = "menuMsgBoxClear";
this.menuMsgBoxClear.Click += new System.EventHandler(this.menuMsgBoxClear_Click);
//
// menuMsgBoxAddRoutingRule
//
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
this.menuMsgBoxAddRoutingRule.Name = "menuMsgBoxAddRoutingRule";
this.menuMsgBoxAddRoutingRule.Click += new System.EventHandler(this.menuMsgBoxAddRoutingRule_Click);
//
// menuMsgBoxFilter
//
resources.ApplyResources(this.menuMsgBoxFilter, "menuMsgBoxFilter");
this.menuMsgBoxFilter.Name = "menuMsgBoxFilter";
this.menuMsgBoxFilter.Click += new System.EventHandler(this.menuMsgBoxFilter_Click);
//
// gbMsgTitle
//
resources.ApplyResources(this.gbMsgTitle, "gbMsgTitle");
this.gbMsgTitle.Controls.Add(this.txtMsgBox);
this.gbMsgTitle.Controls.Add(this.ssMain);
this.gbMsgTitle.Name = "gbMsgTitle";
this.gbMsgTitle.TabStop = false;
//
// ssMain
//
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolSslInboundInfo,
this.toolSslBlank1,
this.toolSslRoutingRule,
this.toolSslBlank2,
this.toolSslServerSpeed,
this.toolSslBlank4});
this.ssMain.Name = "ssMain";
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
//
// toolSslInboundInfo
//
resources.ApplyResources(this.toolSslInboundInfo, "toolSslInboundInfo");
this.toolSslInboundInfo.Name = "toolSslInboundInfo";
//
// toolSslBlank1
//
resources.ApplyResources(this.toolSslBlank1, "toolSslBlank1");
this.toolSslBlank1.Name = "toolSslBlank1";
this.toolSslBlank1.Spring = true;
//
// toolSslRoutingRule
//
resources.ApplyResources(this.toolSslRoutingRule, "toolSslRoutingRule");
this.toolSslRoutingRule.Name = "toolSslRoutingRule";
//
// toolSslBlank2
//
resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
this.toolSslBlank2.Name = "toolSslBlank2";
this.toolSslBlank2.Spring = true;
//
// toolSslServerSpeed
//
resources.ApplyResources(this.toolSslServerSpeed, "toolSslServerSpeed");
this.toolSslServerSpeed.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolSslServerSpeed.Name = "toolSslServerSpeed";
//
// toolSslBlank4
//
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
this.toolSslBlank4.Name = "toolSslBlank4";
//
// MainMsgControl
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.gbMsgTitle);
this.Name = "MainMsgControl";
this.Load += new System.EventHandler(this.MainMsgControl_Load);
this.cmsMsgBox.ResumeLayout(false);
this.gbMsgTitle.ResumeLayout(false);
this.gbMsgTitle.PerformLayout();
this.ssMain.ResumeLayout(false);
this.ssMain.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TextBox txtMsgBox;
private System.Windows.Forms.ContextMenuStrip cmsMsgBox;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopy;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopyAll;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxClear;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxAddRoutingRule;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxFilter;
private System.Windows.Forms.GroupBox gbMsgTitle;
private System.Windows.Forms.StatusStrip ssMain;
private System.Windows.Forms.ToolStripStatusLabel toolSslInboundInfo;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank1;
private System.Windows.Forms.ToolStripStatusLabel toolSslRoutingRule;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank2;
private System.Windows.Forms.ToolStripStatusLabel toolSslServerSpeed;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank4;
}
}

View File

@@ -0,0 +1,204 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms
{
public partial class MainMsgControl : UserControl
{
private string MsgFilter = string.Empty;
delegate void AppendTextDelegate(string text);
public MainMsgControl()
{
InitializeComponent();
}
private void MainMsgControl_Load(object sender, EventArgs e)
{
}
#region
public void AppendText(string text)
{
if (this.txtMsgBox.InvokeRequired)
{
Invoke(new AppendTextDelegate(AppendText), new object[] { text });
}
else
{
if (!Utils.IsNullOrEmpty(MsgFilter))
{
if (!Regex.IsMatch(text, MsgFilter))
{
return;
}
}
//this.txtMsgBox.AppendText(text);
ShowMsg(text);
}
}
/// <summary>
/// 提示信息
/// </summary>
/// <param name="msg"></param>
private void ShowMsg(string msg)
{
if (txtMsgBox.Lines.Length > 999)
{
ClearMsg();
}
this.txtMsgBox.AppendText(msg);
if (!msg.EndsWith(Environment.NewLine))
{
this.txtMsgBox.AppendText(Environment.NewLine);
}
}
/// <summary>
/// 清除信息
/// </summary>
public void ClearMsg()
{
txtMsgBox.Invoke((Action)delegate
{
txtMsgBox.Clear();
});
}
public void DisplayToolStatus(Config config)
{
StringBuilder sb = new StringBuilder();
sb.Append($"{ResUI.LabLocal}:");
sb.Append($"[{Global.InboundSocks}:{config.GetLocalPort(Global.InboundSocks)}]");
sb.Append(" | ");
if (config.sysProxyType == ESysProxyType.ForcedChange)
{
sb.Append($"[{Global.InboundHttp}({ResUI.SystemProxy}):{config.GetLocalPort(Global.InboundHttp)}]");
}
else
{
sb.Append($"[{Global.InboundHttp}:{config.GetLocalPort(Global.InboundHttp)}]");
}
if (config.inbound[0].allowLANConn)
{
sb.Append($" {ResUI.LabLAN}:");
sb.Append($"[{Global.InboundSocks}:{config.GetLocalPort(Global.InboundSocks2)}]");
sb.Append(" | ");
sb.Append($"[{Global.InboundHttp}:{config.GetLocalPort(Global.InboundHttp2)}]");
}
SetToolSslInfo("inbound", sb.ToString());
}
public void SetToolSslInfo(string type, string value)
{
switch (type)
{
case "speed":
toolSslServerSpeed.Text = value;
break;
case "inbound":
toolSslInboundInfo.Text = value;
break;
case "routing":
toolSslRoutingRule.Text = value;
break;
}
}
public void ScrollToCaret()
{
this.txtMsgBox.ScrollToCaret();
}
#endregion
#region MsgBoxMenu
private void menuMsgBoxSelectAll_Click(object sender, EventArgs e)
{
this.txtMsgBox.Focus();
this.txtMsgBox.SelectAll();
}
private void menuMsgBoxCopy_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.SelectedText.TrimEx();
Utils.SetClipboardData(data);
}
private void menuMsgBoxCopyAll_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.Text;
Utils.SetClipboardData(data);
}
private void menuMsgBoxClear_Click(object sender, EventArgs e)
{
this.txtMsgBox.Clear();
}
private void menuMsgBoxAddRoutingRule_Click(object sender, EventArgs e)
{
menuMsgBoxCopy_Click(null, null);
var fm = new RoutingSettingForm();
fm.ShowDialog();
}
private void txtMsgBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
switch (e.KeyCode)
{
case Keys.A:
menuMsgBoxSelectAll_Click(null, null);
break;
case Keys.C:
menuMsgBoxCopy_Click(null, null);
break;
case Keys.V:
menuMsgBoxAddRoutingRule_Click(null, null);
break;
}
}
}
private void menuMsgBoxFilter_Click(object sender, EventArgs e)
{
var fm = new MsgFilterSetForm();
fm.MsgFilter = MsgFilter;
if (fm.ShowDialog() == DialogResult.OK)
{
MsgFilter = fm.MsgFilter;
gbMsgTitle.Text = string.Format(ResUI.MsgInformationTitle, MsgFilter);
}
}
private void ssMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (!Utils.IsNullOrEmpty(e.ClickedItem.Text))
{
Utils.SetClipboardData(e.ClickedItem.Text);
}
}
#endregion
}
}

View File

@@ -0,0 +1,387 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="&gt;&gt;toolSslRoutingRule.Name" xml:space="preserve">
<value>toolSslRoutingRule</value>
</data>
<data name="&gt;&gt;gbMsgTitle.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="menuMsgBoxSelectAll.Text" xml:space="preserve">
<value>Select All (Ctrl+A)</value>
</data>
<data name="&gt;&gt;ssMain.Name" xml:space="preserve">
<value>ssMain</value>
</data>
<data name="&gt;&gt;menuMsgBoxSelectAll.Name" xml:space="preserve">
<value>menuMsgBoxSelectAll</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="toolSslServerSpeed.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;menuMsgBoxClear.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslServerSpeed.Name" xml:space="preserve">
<value>toolSslServerSpeed</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopyAll.Name" xml:space="preserve">
<value>menuMsgBoxCopyAll</value>
</data>
<data name="txtMsgBox.MaxLength" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;gbMsgTitle.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="ssMain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 221</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="menuMsgBoxFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="&gt;&gt;toolSslBlank2.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslBlank1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslInboundInfo.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="toolSslRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="toolSslInboundInfo.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 17</value>
</data>
<data name="&gt;&gt;toolSslInboundInfo.Name" xml:space="preserve">
<value>toolSslInboundInfo</value>
</data>
<data name="&gt;&gt;txtMsgBox.Name" xml:space="preserve">
<value>txtMsgBox</value>
</data>
<data name="toolSslBlank4.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="&gt;&gt;menuMsgBoxFilter.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="toolSslBlank1.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="&gt;&gt;ssMain.Parent" xml:space="preserve">
<value>gbMsgTitle</value>
</data>
<data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="&gt;&gt;toolSslRoutingRule.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
<value>Add Routing Rule (Ctrl+V)</value>
</data>
<data name="toolSslServerSpeed.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleRight</value>
</data>
<data name="toolSslServerSpeed.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="gbMsgTitle.Size" type="System.Drawing.Size, System.Drawing">
<value>696, 246</value>
</data>
<data name="toolSslInboundInfo.Text" xml:space="preserve">
<value>InboundInfo</value>
</data>
<data name="&gt;&gt;menuMsgBoxAddRoutingRule.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxClear.Name" xml:space="preserve">
<value>menuMsgBoxClear</value>
</data>
<data name="txtMsgBox.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="gbMsgTitle.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopy.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtMsgBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="&gt;&gt;toolSslBlank4.Name" xml:space="preserve">
<value>toolSslBlank4</value>
</data>
<data name="&gt;&gt;txtMsgBox.Parent" xml:space="preserve">
<value>gbMsgTitle</value>
</data>
<data name="gbMsgTitle.Text" xml:space="preserve">
<value>Informations</value>
</data>
<data name="ssMain.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 17</value>
</data>
<data name="txtMsgBox.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="menuMsgBoxClear.Text" xml:space="preserve">
<value>Clear All</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="txtMsgBox.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="&gt;&gt;gbMsgTitle.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="ssMain.Size" type="System.Drawing.Size, System.Drawing">
<value>690, 22</value>
</data>
<data name="&gt;&gt;cmsMsgBox.Name" xml:space="preserve">
<value>cmsMsgBox</value>
</data>
<data name="txtMsgBox.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;cmsMsgBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;ssMain.Type" xml:space="preserve">
<value>System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="gbMsgTitle.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>690, 204</value>
</data>
<data name="menuMsgBoxClear.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 22</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 17</value>
</data>
<data name="&gt;&gt;toolSslBlank4.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MainMsgControl</value>
</data>
<data name="gbMsgTitle.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>696, 246</value>
</data>
<data name="&gt;&gt;toolSslBlank1.Name" xml:space="preserve">
<value>toolSslBlank1</value>
</data>
<data name="toolSslServerSpeed.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>No</value>
</data>
<data name="menuMsgBoxCopyAll.Text" xml:space="preserve">
<value>Copy All</value>
</data>
<data name="toolSslServerSpeed.Size" type="System.Drawing.Size, System.Drawing">
<value>250, 17</value>
</data>
<data name="ssMain.Text" xml:space="preserve">
<value>statusStrip1</value>
</data>
<data name="&gt;&gt;menuMsgBoxAddRoutingRule.Name" xml:space="preserve">
<value>menuMsgBoxAddRoutingRule</value>
</data>
<data name="&gt;&gt;toolSslBlank2.Name" xml:space="preserve">
<value>toolSslBlank2</value>
</data>
<data name="menuMsgBoxFilter.Text" xml:space="preserve">
<value>Set message filters</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>SPEED Disabled</value>
</data>
<data name="&gt;&gt;txtMsgBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;gbMsgTitle.Name" xml:space="preserve">
<value>gbMsgTitle</value>
</data>
<data name="&gt;&gt;menuMsgBoxFilter.Name" xml:space="preserve">
<value>menuMsgBoxFilter</value>
</data>
<data name="&gt;&gt;ssMain.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxSelectAll.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopy.Name" xml:space="preserve">
<value>menuMsgBoxCopy</value>
</data>
<data name="&gt;&gt;txtMsgBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslServerSpeed.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="menuMsgBoxCopy.Text" xml:space="preserve">
<value>Copy (Ctrl+C)</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>228, 136</value>
</data>
<data name="&gt;&gt;menuMsgBoxCopyAll.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>131, 18</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>zh-Hans</value>
</metadata>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cmsMsgBox.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxCopy.Text" xml:space="preserve">
<value>复制 (Ctrl+C)</value>
</data>
<data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxCopyAll.Text" xml:space="preserve">
<value>复制所有</value>
</data>
<data name="menuMsgBoxClear.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxClear.Text" xml:space="preserve">
<value>清除所有</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
<value>快速添加路由规则 (Ctrl+V)</value>
</data>
<data name="menuMsgBoxFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxFilter.Text" xml:space="preserve">
<value>设置信息过滤器</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 136</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>157, 17</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>157, 17</value>
</data>
<data name="gbMsgTitle.Text" xml:space="preserve">
<value>信息</value>
</data>
</root>

View File

@@ -34,14 +34,18 @@
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button(); this.btnOK = new System.Windows.Forms.Button();
this.btnFilterDirect = new System.Windows.Forms.Button();
this.btnFilderProxy = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupBox1 // groupBox1
// //
resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Controls.Add(this.btnFilderProxy);
this.groupBox1.Controls.Add(this.btnFilterDirect);
this.groupBox1.Controls.Add(this.txtMsgFilter); this.groupBox1.Controls.Add(this.txtMsgFilter);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
@@ -52,15 +56,15 @@
// //
// panel2 // panel2
// //
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose); this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK); this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
// //
// btnClose // btnClose
// //
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true; this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click); this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
@@ -72,6 +76,20 @@
this.btnOK.UseVisualStyleBackColor = true; this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click); this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
// //
// btnFilterDirect
//
resources.ApplyResources(this.btnFilterDirect, "btnFilterDirect");
this.btnFilterDirect.Name = "btnFilterDirect";
this.btnFilterDirect.UseVisualStyleBackColor = true;
this.btnFilterDirect.Click += new System.EventHandler(this.btnFilterDirect_Click);
//
// btnFilderProxy
//
resources.ApplyResources(this.btnFilderProxy, "btnFilderProxy");
this.btnFilderProxy.Name = "btnFilderProxy";
this.btnFilderProxy.UseVisualStyleBackColor = true;
this.btnFilderProxy.Click += new System.EventHandler(this.btnFilderProxy_Click);
//
// MsgFilterSetForm // MsgFilterSetForm
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@@ -94,5 +112,7 @@
private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btnClose; private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK; private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnFilderProxy;
private System.Windows.Forms.Button btnFilterDirect;
} }
} }

View File

@@ -34,5 +34,15 @@ namespace v2rayN.Forms
{ {
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
} }
private void btnFilderProxy_Click(object sender, EventArgs e)
{
txtMsgFilter.Text = "^(?!.*proxy).*$";
}
private void btnFilterDirect_Click(object sender, EventArgs e)
{
txtMsgFilter.Text = "^(?!.*direct).*$";
}
} }
} }

View File

@@ -117,151 +117,226 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;txtMsgFilter.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;txtMsgFilter.Name" xml:space="preserve">
<value>txtMsgFilter</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;txtMsgFilter.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="txtMsgFilter.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnFilderProxy.Location" type="System.Drawing.Point, System.Drawing">
<value>41, 29</value> <value>157, 47</value>
</data> </data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing"> <data name="btnFilderProxy.Size" type="System.Drawing.Size, System.Drawing">
<value>490, 60</value> <value>95, 23</value>
</data> </data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="txtMsgFilter.TabIndex" type="System.Int32, mscorlib"> <data name="btnFilderProxy.TabIndex" type="System.Int32, mscorlib">
<value>11</value> <value>13</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="btnFilderProxy.Text" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value> <value>Filter Proxy</value>
</data> </data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve"> <data name="&gt;&gt;btnFilderProxy.Name" xml:space="preserve">
<value>panel2</value> <value>btnFilderProxy</value>
</data> </data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve"> <data name="&gt;&gt;btnFilderProxy.Type" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 17</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve"> <data name="&gt;&gt;btnFilderProxy.Parent" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>groupBox1</value>
</data> </data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="&gt;&gt;btnFilderProxy.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnFilterDirect.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve"> <data name="btnFilterDirect.Location" type="System.Drawing.Point, System.Drawing">
<value>panel2</value> <value>41, 47</value>
</data> </data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib"> <data name="btnFilterDirect.Size" type="System.Drawing.Size, System.Drawing">
<value>4</value> <value>95, 23</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="btnFilterDirect.TabIndex" type="System.Int32, mscorlib">
<value>MsgFilterSetForm</value> <value>12</value>
</data>
<data name="btnFilterDirect.Text" xml:space="preserve">
<value>Filter Direct</value>
</data>
<data name="&gt;&gt;btnFilterDirect.Name" xml:space="preserve">
<value>btnFilterDirect</value>
</data>
<data name="&gt;&gt;btnFilterDirect.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnFilterDirect.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnFilterDirect.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtMsgFilter.Location" type="System.Drawing.Point, System.Drawing">
<value>41, 20</value>
</data> </data>
<data name="txtMsgFilter.Size" type="System.Drawing.Size, System.Drawing"> <data name="txtMsgFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>409, 21</value> <value>409, 21</value>
</data> </data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve"> <data name="txtMsgFilter.TabIndex" type="System.Int32, mscorlib">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>11</value>
</data> </data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing"> <data name="&gt;&gt;txtMsgFilter.Name" xml:space="preserve">
<value>0, 0</value> <value>txtMsgFilter</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 76</value>
</data> </data>
<data name="&gt;&gt;txtMsgFilter.Type" xml:space="preserve"> <data name="&gt;&gt;txtMsgFilter.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="&gt;&gt;txtMsgFilter.Parent" xml:space="preserve">
<value>Bottom</value> <value>groupBox1</value>
</data>
<data name="&gt;&gt;txtMsgFilter.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data> </data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing"> <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>490, 76</value> <value>490, 76</value>
</data> </data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve"> <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>8</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data> </data>
<data name="groupBox1.Text" xml:space="preserve"> <data name="groupBox1.Text" xml:space="preserve">
<value>Filter</value> <value>Filter</value>
</data> </data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve"> <data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value> <value>btnOK</value>
</data> </data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>490, 136</value> <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>75, 23</value> <value>panel2</value>
</data> </data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing"> <data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>303, 17</value> <value>1</value>
</data> </data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing"> <data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>6, 12</value> <value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 76</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>490, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve"> <data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
</data> </data>
<data name="$this.Text" xml:space="preserve"> <data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>MsgFilterSetForm</value> <value>1</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>490, 136</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>MsgFilterSetForm</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MsgFilterSetForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root> </root>

View File

@@ -129,4 +129,10 @@
<data name="$this.Text" xml:space="preserve"> <data name="$this.Text" xml:space="preserve">
<value>设置过滤器</value> <value>设置过滤器</value>
</data> </data>
<data name="btnFilderProxy.Text" xml:space="preserve">
<value>过滤Proxy</value>
</data>
<data name="btnFilterDirect.Text" xml:space="preserve">
<value>过滤Direct</value>
</data>
</root> </root>

View File

@@ -33,15 +33,14 @@
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label16 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtpass = new System.Windows.Forms.TextBox();
this.txtuser = new System.Windows.Forms.TextBox();
this.chkdefAllowInsecure = new System.Windows.Forms.CheckBox(); this.chkdefAllowInsecure = new System.Windows.Forms.CheckBox();
this.chksniffingEnabled2 = new System.Windows.Forms.CheckBox(); this.chkAllowLANConn = new System.Windows.Forms.CheckBox();
this.chksniffingEnabled = new System.Windows.Forms.CheckBox(); this.chksniffingEnabled = new System.Windows.Forms.CheckBox();
this.chkmuxEnabled = new System.Windows.Forms.CheckBox(); this.chkmuxEnabled = new System.Windows.Forms.CheckBox();
this.chkAllowIn2 = new System.Windows.Forms.CheckBox();
this.chkudpEnabled2 = new System.Windows.Forms.CheckBox();
this.cmbprotocol2 = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.txtlocalPort2 = new System.Windows.Forms.TextBox();
this.cmbprotocol = new System.Windows.Forms.ComboBox(); this.cmbprotocol = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.chkudpEnabled = new System.Windows.Forms.CheckBox(); this.chkudpEnabled = new System.Windows.Forms.CheckBox();
@@ -69,6 +68,8 @@
this.txtKcpmtu = new System.Windows.Forms.TextBox(); this.txtKcpmtu = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage(); this.tabPage7 = new System.Windows.Forms.TabPage();
this.txtautoUpdateSubInterval = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.chkEnableSecurityProtocolTls13 = new System.Windows.Forms.CheckBox(); this.chkEnableSecurityProtocolTls13 = new System.Windows.Forms.CheckBox();
this.chkEnableAutoAdjustMainLvColWidth = new System.Windows.Forms.CheckBox(); this.chkEnableAutoAdjustMainLvColWidth = new System.Windows.Forms.CheckBox();
this.btnSetLoopback = new System.Windows.Forms.Button(); this.btnSetLoopback = new System.Windows.Forms.Button();
@@ -79,7 +80,6 @@
this.cbFreshrate = new System.Windows.Forms.ComboBox(); this.cbFreshrate = new System.Windows.Forms.ComboBox();
this.lbFreshrate = new System.Windows.Forms.Label(); this.lbFreshrate = new System.Windows.Forms.Label();
this.chkEnableStatistics = new System.Windows.Forms.CheckBox(); this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
this.chkAllowLANConn = new System.Windows.Forms.CheckBox();
this.chkAutoRun = new System.Windows.Forms.CheckBox(); this.chkAutoRun = new System.Windows.Forms.CheckBox();
this.tabPageCoreType = new System.Windows.Forms.TabPage(); this.tabPageCoreType = new System.Windows.Forms.TabPage();
this.cmbCoreType6 = new System.Windows.Forms.ComboBox(); this.cmbCoreType6 = new System.Windows.Forms.ComboBox();
@@ -116,42 +116,42 @@
// //
// btnClose // btnClose
// //
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose"); resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true; this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click); this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
// //
// tabControl1 // tabControl1
// //
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPageCoreType); this.tabControl1.Controls.Add(this.tabPageCoreType);
this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage3);
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0; this.tabControl1.SelectedIndex = 0;
// //
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.groupBox1);
resources.ApplyResources(this.tabPage1, "tabPage1"); resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// groupBox1 // groupBox1
// //
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.txtpass);
this.groupBox1.Controls.Add(this.txtuser);
this.groupBox1.Controls.Add(this.chkdefAllowInsecure); this.groupBox1.Controls.Add(this.chkdefAllowInsecure);
this.groupBox1.Controls.Add(this.chksniffingEnabled2); this.groupBox1.Controls.Add(this.chkAllowLANConn);
this.groupBox1.Controls.Add(this.chksniffingEnabled); this.groupBox1.Controls.Add(this.chksniffingEnabled);
this.groupBox1.Controls.Add(this.chkmuxEnabled); this.groupBox1.Controls.Add(this.chkmuxEnabled);
this.groupBox1.Controls.Add(this.chkAllowIn2);
this.groupBox1.Controls.Add(this.chkudpEnabled2);
this.groupBox1.Controls.Add(this.cmbprotocol2);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.txtlocalPort2);
this.groupBox1.Controls.Add(this.cmbprotocol); this.groupBox1.Controls.Add(this.cmbprotocol);
this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.chkudpEnabled); this.groupBox1.Controls.Add(this.chkudpEnabled);
@@ -160,21 +160,40 @@
this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtlocalPort); this.groupBox1.Controls.Add(this.txtlocalPort);
this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label2);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
// label16
//
resources.ApplyResources(this.label16, "label16");
this.label16.Name = "label16";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// txtpass
//
resources.ApplyResources(this.txtpass, "txtpass");
this.txtpass.Name = "txtpass";
//
// txtuser
//
resources.ApplyResources(this.txtuser, "txtuser");
this.txtuser.Name = "txtuser";
//
// chkdefAllowInsecure // chkdefAllowInsecure
// //
resources.ApplyResources(this.chkdefAllowInsecure, "chkdefAllowInsecure"); resources.ApplyResources(this.chkdefAllowInsecure, "chkdefAllowInsecure");
this.chkdefAllowInsecure.Name = "chkdefAllowInsecure"; this.chkdefAllowInsecure.Name = "chkdefAllowInsecure";
this.chkdefAllowInsecure.UseVisualStyleBackColor = true; this.chkdefAllowInsecure.UseVisualStyleBackColor = true;
// //
// chksniffingEnabled2 // chkAllowLANConn
// //
resources.ApplyResources(this.chksniffingEnabled2, "chksniffingEnabled2"); resources.ApplyResources(this.chkAllowLANConn, "chkAllowLANConn");
this.chksniffingEnabled2.Name = "chksniffingEnabled2"; this.chkAllowLANConn.Name = "chkAllowLANConn";
this.chksniffingEnabled2.UseVisualStyleBackColor = true; this.chkAllowLANConn.UseVisualStyleBackColor = true;
// //
// chksniffingEnabled // chksniffingEnabled
// //
@@ -188,43 +207,10 @@
this.chkmuxEnabled.Name = "chkmuxEnabled"; this.chkmuxEnabled.Name = "chkmuxEnabled";
this.chkmuxEnabled.UseVisualStyleBackColor = true; this.chkmuxEnabled.UseVisualStyleBackColor = true;
// //
// chkAllowIn2
//
resources.ApplyResources(this.chkAllowIn2, "chkAllowIn2");
this.chkAllowIn2.Name = "chkAllowIn2";
this.chkAllowIn2.UseVisualStyleBackColor = true;
this.chkAllowIn2.CheckedChanged += new System.EventHandler(this.chkAllowIn2_CheckedChanged);
//
// chkudpEnabled2
//
resources.ApplyResources(this.chkudpEnabled2, "chkudpEnabled2");
this.chkudpEnabled2.Name = "chkudpEnabled2";
this.chkudpEnabled2.UseVisualStyleBackColor = true;
//
// cmbprotocol2
//
this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbprotocol2.FormattingEnabled = true;
this.cmbprotocol2.Items.AddRange(new object[] {
resources.GetString("cmbprotocol2.Items"),
resources.GetString("cmbprotocol2.Items1")});
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
this.cmbprotocol2.Name = "cmbprotocol2";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// txtlocalPort2
//
resources.ApplyResources(this.txtlocalPort2, "txtlocalPort2");
this.txtlocalPort2.Name = "txtlocalPort2";
//
// cmbprotocol // cmbprotocol
// //
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
resources.ApplyResources(this.cmbprotocol, "cmbprotocol"); resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbprotocol.FormattingEnabled = true; this.cmbprotocol.FormattingEnabled = true;
this.cmbprotocol.Items.AddRange(new object[] { this.cmbprotocol.Items.AddRange(new object[] {
resources.GetString("cmbprotocol.Items"), resources.GetString("cmbprotocol.Items"),
@@ -250,6 +236,7 @@
// //
// cmbloglevel // cmbloglevel
// //
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbloglevel.FormattingEnabled = true; this.cmbloglevel.FormattingEnabled = true;
this.cmbloglevel.Items.AddRange(new object[] { this.cmbloglevel.Items.AddRange(new object[] {
@@ -258,7 +245,6 @@
resources.GetString("cmbloglevel.Items2"), resources.GetString("cmbloglevel.Items2"),
resources.GetString("cmbloglevel.Items3"), resources.GetString("cmbloglevel.Items3"),
resources.GetString("cmbloglevel.Items4")}); resources.GetString("cmbloglevel.Items4")});
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.Name = "cmbloglevel"; this.cmbloglevel.Name = "cmbloglevel";
// //
// label5 // label5
@@ -278,10 +264,10 @@
// //
// tabPage2 // tabPage2
// //
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Controls.Add(this.linkDnsObjectDoc); this.tabPage2.Controls.Add(this.linkDnsObjectDoc);
this.tabPage2.Controls.Add(this.txtremoteDNS); this.tabPage2.Controls.Add(this.txtremoteDNS);
this.tabPage2.Controls.Add(this.label14); this.tabPage2.Controls.Add(this.label14);
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Name = "tabPage2"; this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.UseVisualStyleBackColor = true;
// //
@@ -304,6 +290,7 @@
// //
// tabPage6 // tabPage6
// //
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Controls.Add(this.chkKcpcongestion); this.tabPage6.Controls.Add(this.chkKcpcongestion);
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize); this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
this.tabPage6.Controls.Add(this.label10); this.tabPage6.Controls.Add(this.label10);
@@ -317,7 +304,6 @@
this.tabPage6.Controls.Add(this.label7); this.tabPage6.Controls.Add(this.label7);
this.tabPage6.Controls.Add(this.txtKcpmtu); this.tabPage6.Controls.Add(this.txtKcpmtu);
this.tabPage6.Controls.Add(this.label6); this.tabPage6.Controls.Add(this.label6);
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Name = "tabPage6"; this.tabPage6.Name = "tabPage6";
this.tabPage6.UseVisualStyleBackColor = true; this.tabPage6.UseVisualStyleBackColor = true;
// //
@@ -389,6 +375,9 @@
// //
// tabPage7 // tabPage7
// //
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Controls.Add(this.txtautoUpdateSubInterval);
this.tabPage7.Controls.Add(this.label3);
this.tabPage7.Controls.Add(this.chkEnableSecurityProtocolTls13); this.tabPage7.Controls.Add(this.chkEnableSecurityProtocolTls13);
this.tabPage7.Controls.Add(this.chkEnableAutoAdjustMainLvColWidth); this.tabPage7.Controls.Add(this.chkEnableAutoAdjustMainLvColWidth);
this.tabPage7.Controls.Add(this.btnSetLoopback); this.tabPage7.Controls.Add(this.btnSetLoopback);
@@ -399,12 +388,20 @@
this.tabPage7.Controls.Add(this.cbFreshrate); this.tabPage7.Controls.Add(this.cbFreshrate);
this.tabPage7.Controls.Add(this.lbFreshrate); this.tabPage7.Controls.Add(this.lbFreshrate);
this.tabPage7.Controls.Add(this.chkEnableStatistics); this.tabPage7.Controls.Add(this.chkEnableStatistics);
this.tabPage7.Controls.Add(this.chkAllowLANConn);
this.tabPage7.Controls.Add(this.chkAutoRun); this.tabPage7.Controls.Add(this.chkAutoRun);
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Name = "tabPage7"; this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true; this.tabPage7.UseVisualStyleBackColor = true;
// //
// txtautoUpdateSubInterval
//
resources.ApplyResources(this.txtautoUpdateSubInterval, "txtautoUpdateSubInterval");
this.txtautoUpdateSubInterval.Name = "txtautoUpdateSubInterval";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// chkEnableSecurityProtocolTls13 // chkEnableSecurityProtocolTls13
// //
resources.ApplyResources(this.chkEnableSecurityProtocolTls13, "chkEnableSecurityProtocolTls13"); resources.ApplyResources(this.chkEnableSecurityProtocolTls13, "chkEnableSecurityProtocolTls13");
@@ -448,9 +445,9 @@
// //
// cbFreshrate // cbFreshrate
// //
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbFreshrate.FormattingEnabled = true; this.cbFreshrate.FormattingEnabled = true;
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.Name = "cbFreshrate"; this.cbFreshrate.Name = "cbFreshrate";
// //
// lbFreshrate // lbFreshrate
@@ -464,12 +461,6 @@
this.chkEnableStatistics.Name = "chkEnableStatistics"; this.chkEnableStatistics.Name = "chkEnableStatistics";
this.chkEnableStatistics.UseVisualStyleBackColor = true; this.chkEnableStatistics.UseVisualStyleBackColor = true;
// //
// chkAllowLANConn
//
resources.ApplyResources(this.chkAllowLANConn, "chkAllowLANConn");
this.chkAllowLANConn.Name = "chkAllowLANConn";
this.chkAllowLANConn.UseVisualStyleBackColor = true;
//
// chkAutoRun // chkAutoRun
// //
resources.ApplyResources(this.chkAutoRun, "chkAutoRun"); resources.ApplyResources(this.chkAutoRun, "chkAutoRun");
@@ -478,6 +469,7 @@
// //
// tabPageCoreType // tabPageCoreType
// //
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
this.tabPageCoreType.Controls.Add(this.cmbCoreType6); this.tabPageCoreType.Controls.Add(this.cmbCoreType6);
this.tabPageCoreType.Controls.Add(this.labCoreType6); this.tabPageCoreType.Controls.Add(this.labCoreType6);
this.tabPageCoreType.Controls.Add(this.cmbCoreType5); this.tabPageCoreType.Controls.Add(this.cmbCoreType5);
@@ -490,15 +482,14 @@
this.tabPageCoreType.Controls.Add(this.labCoreType2); this.tabPageCoreType.Controls.Add(this.labCoreType2);
this.tabPageCoreType.Controls.Add(this.cmbCoreType1); this.tabPageCoreType.Controls.Add(this.cmbCoreType1);
this.tabPageCoreType.Controls.Add(this.labCoreType1); this.tabPageCoreType.Controls.Add(this.labCoreType1);
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
this.tabPageCoreType.Name = "tabPageCoreType"; this.tabPageCoreType.Name = "tabPageCoreType";
this.tabPageCoreType.UseVisualStyleBackColor = true; this.tabPageCoreType.UseVisualStyleBackColor = true;
// //
// cmbCoreType6 // cmbCoreType6
// //
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType6.FormattingEnabled = true; this.cmbCoreType6.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
this.cmbCoreType6.Name = "cmbCoreType6"; this.cmbCoreType6.Name = "cmbCoreType6";
// //
// labCoreType6 // labCoreType6
@@ -508,9 +499,9 @@
// //
// cmbCoreType5 // cmbCoreType5
// //
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType5.FormattingEnabled = true; this.cmbCoreType5.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
this.cmbCoreType5.Name = "cmbCoreType5"; this.cmbCoreType5.Name = "cmbCoreType5";
// //
// labCoreType5 // labCoreType5
@@ -520,9 +511,9 @@
// //
// cmbCoreType4 // cmbCoreType4
// //
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType4.FormattingEnabled = true; this.cmbCoreType4.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
this.cmbCoreType4.Name = "cmbCoreType4"; this.cmbCoreType4.Name = "cmbCoreType4";
// //
// labCoreType4 // labCoreType4
@@ -532,9 +523,9 @@
// //
// cmbCoreType3 // cmbCoreType3
// //
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType3.FormattingEnabled = true; this.cmbCoreType3.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
this.cmbCoreType3.Name = "cmbCoreType3"; this.cmbCoreType3.Name = "cmbCoreType3";
// //
// labCoreType3 // labCoreType3
@@ -544,9 +535,9 @@
// //
// cmbCoreType2 // cmbCoreType2
// //
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType2.FormattingEnabled = true; this.cmbCoreType2.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
this.cmbCoreType2.Name = "cmbCoreType2"; this.cmbCoreType2.Name = "cmbCoreType2";
// //
// labCoreType2 // labCoreType2
@@ -556,9 +547,9 @@
// //
// cmbCoreType1 // cmbCoreType1
// //
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType1.FormattingEnabled = true; this.cmbCoreType1.FormattingEnabled = true;
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
this.cmbCoreType1.Name = "cmbCoreType1"; this.cmbCoreType1.Name = "cmbCoreType1";
// //
// labCoreType1 // labCoreType1
@@ -568,17 +559,17 @@
// //
// tabPage3 // tabPage3
// //
this.tabPage3.Controls.Add(this.groupBox2);
resources.ApplyResources(this.tabPage3, "tabPage3"); resources.ApplyResources(this.tabPage3, "tabPage3");
this.tabPage3.Controls.Add(this.groupBox2);
this.tabPage3.Name = "tabPage3"; this.tabPage3.Name = "tabPage3";
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage3.UseVisualStyleBackColor = true;
// //
// groupBox2 // groupBox2
// //
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.label13); this.groupBox2.Controls.Add(this.label13);
this.groupBox2.Controls.Add(this.label12); this.groupBox2.Controls.Add(this.label12);
this.groupBox2.Controls.Add(this.txtsystemProxyExceptions); this.groupBox2.Controls.Add(this.txtsystemProxyExceptions);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
// //
@@ -599,9 +590,9 @@
// //
// panel2 // panel2
// //
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose); this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK); this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
// //
// btnOK // btnOK
@@ -664,11 +655,6 @@
private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.ComboBox cmbprotocol; private System.Windows.Forms.ComboBox cmbprotocol;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cmbprotocol2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtlocalPort2;
private System.Windows.Forms.CheckBox chkudpEnabled2;
private System.Windows.Forms.CheckBox chkAllowIn2;
private System.Windows.Forms.CheckBox chkmuxEnabled; private System.Windows.Forms.CheckBox chkmuxEnabled;
private System.Windows.Forms.TabPage tabPage6; private System.Windows.Forms.TabPage tabPage6;
private System.Windows.Forms.TextBox txtKcpmtu; private System.Windows.Forms.TextBox txtKcpmtu;
@@ -688,7 +674,6 @@
private System.Windows.Forms.CheckBox chkAutoRun; private System.Windows.Forms.CheckBox chkAutoRun;
private System.Windows.Forms.CheckBox chkAllowLANConn; private System.Windows.Forms.CheckBox chkAllowLANConn;
private System.Windows.Forms.CheckBox chksniffingEnabled; private System.Windows.Forms.CheckBox chksniffingEnabled;
private System.Windows.Forms.CheckBox chksniffingEnabled2;
private System.Windows.Forms.CheckBox chkEnableStatistics; private System.Windows.Forms.CheckBox chkEnableStatistics;
private System.Windows.Forms.ComboBox cbFreshrate; private System.Windows.Forms.ComboBox cbFreshrate;
private System.Windows.Forms.Label lbFreshrate; private System.Windows.Forms.Label lbFreshrate;
@@ -722,5 +707,11 @@
private System.Windows.Forms.Label labCoreType3; private System.Windows.Forms.Label labCoreType3;
private System.Windows.Forms.ComboBox cmbCoreType2; private System.Windows.Forms.ComboBox cmbCoreType2;
private System.Windows.Forms.Label labCoreType2; private System.Windows.Forms.Label labCoreType2;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtpass;
private System.Windows.Forms.TextBox txtuser;
private System.Windows.Forms.TextBox txtautoUpdateSubInterval;
private System.Windows.Forms.Label label3;
} }
} }

View File

@@ -5,6 +5,7 @@ using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -45,23 +46,10 @@ namespace v2rayN.Forms
cmbprotocol.Text = config.inbound[0].protocol.ToString(); cmbprotocol.Text = config.inbound[0].protocol.ToString();
chkudpEnabled.Checked = config.inbound[0].udpEnabled; chkudpEnabled.Checked = config.inbound[0].udpEnabled;
chksniffingEnabled.Checked = config.inbound[0].sniffingEnabled; chksniffingEnabled.Checked = config.inbound[0].sniffingEnabled;
chkAllowLANConn.Checked = config.inbound[0].allowLANConn;
txtuser.Text = config.inbound[0].user;
txtpass.Text = config.inbound[0].pass;
txtlocalPort2.Text = $"{config.inbound[0].localPort + 1}";
cmbprotocol2.Text = Global.InboundHttp;
if (config.inbound.Count > 1)
{
txtlocalPort2.Text = config.inbound[1].localPort.ToString();
cmbprotocol2.Text = config.inbound[1].protocol.ToString();
chkudpEnabled2.Checked = config.inbound[1].udpEnabled;
chksniffingEnabled2.Checked = config.inbound[1].sniffingEnabled;
chkAllowIn2.Checked = true;
}
else
{
chkAllowIn2.Checked = false;
}
chkAllowIn2State();
} }
//remoteDNS //remoteDNS
@@ -95,15 +83,14 @@ namespace v2rayN.Forms
//开机自动启动 //开机自动启动
chkAutoRun.Checked = Utils.IsAutoRun(); chkAutoRun.Checked = Utils.IsAutoRun();
chkAllowLANConn.Checked = config.allowLANConn;
chkEnableStatistics.Checked = config.enableStatistics; chkEnableStatistics.Checked = config.enableStatistics;
chkKeepOlderDedupl.Checked = config.keepOlderDedupl; chkKeepOlderDedupl.Checked = config.keepOlderDedupl;
ComboItem[] cbSource = new ComboItem[] ComboItem[] cbSource = new ComboItem[]
{ {
new ComboItem{ID = (int)Global.StatisticsFreshRate.quick, Text = UIRes.I18N("QuickFresh")}, new ComboItem{ID = (int)Global.StatisticsFreshRate.quick, Text = ResUI.QuickFresh},
new ComboItem{ID = (int)Global.StatisticsFreshRate.medium, Text = UIRes.I18N("MediumFresh")}, new ComboItem{ID = (int)Global.StatisticsFreshRate.medium, Text = ResUI.MediumFresh},
new ComboItem{ID = (int)Global.StatisticsFreshRate.slow, Text = UIRes.I18N("SlowFresh")}, new ComboItem{ID = (int)Global.StatisticsFreshRate.slow, Text = ResUI.SlowFresh},
}; };
cbFreshrate.DataSource = cbSource; cbFreshrate.DataSource = cbSource;
@@ -125,6 +112,7 @@ namespace v2rayN.Forms
chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore; chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore;
txtautoUpdateInterval.Text = config.autoUpdateInterval.ToString(); txtautoUpdateInterval.Text = config.autoUpdateInterval.ToString();
txtautoUpdateSubInterval.Text = config.autoUpdateSubInterval.ToString();
chkEnableAutoAdjustMainLvColWidth.Checked = config.uiItem.enableAutoAdjustMainLvColWidth; chkEnableAutoAdjustMainLvColWidth.Checked = config.uiItem.enableAutoAdjustMainLvColWidth;
chkEnableSecurityProtocolTls13.Checked = config.enableSecurityProtocolTls13; chkEnableSecurityProtocolTls13.Checked = config.enableSecurityProtocolTls13;
} }
@@ -187,7 +175,7 @@ namespace v2rayN.Forms
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("OperationFailed")); UI.ShowWarning(ResUI.OperationFailed);
} }
} }
@@ -209,14 +197,15 @@ namespace v2rayN.Forms
string protocol = cmbprotocol.Text.TrimEx(); string protocol = cmbprotocol.Text.TrimEx();
bool udpEnabled = chkudpEnabled.Checked; bool udpEnabled = chkudpEnabled.Checked;
bool sniffingEnabled = chksniffingEnabled.Checked; bool sniffingEnabled = chksniffingEnabled.Checked;
bool allowLANConn = chkAllowLANConn.Checked;
if (Utils.IsNullOrEmpty(localPort) || !Utils.IsNumberic(localPort)) if (Utils.IsNullOrEmpty(localPort) || !Utils.IsNumberic(localPort))
{ {
UI.Show(UIRes.I18N("FillLocalListeningPort")); UI.Show(ResUI.FillLocalListeningPort);
return -1; return -1;
} }
if (Utils.IsNullOrEmpty(protocol)) if (Utils.IsNullOrEmpty(protocol))
{ {
UI.Show(UIRes.I18N("PleaseSelectProtocol")); UI.Show(ResUI.PleaseSelectProtocol);
return -1; return -1;
} }
@@ -229,7 +218,7 @@ namespace v2rayN.Forms
{ {
if (remoteDNS.Contains("{") || remoteDNS.Contains("}")) if (remoteDNS.Contains("{") || remoteDNS.Contains("}"))
{ {
UI.Show(UIRes.I18N("FillCorrectDNSText")); UI.Show(ResUI.FillCorrectDNSText);
return -1; return -1;
} }
} }
@@ -238,41 +227,16 @@ namespace v2rayN.Forms
config.inbound[0].protocol = protocol; config.inbound[0].protocol = protocol;
config.inbound[0].udpEnabled = udpEnabled; config.inbound[0].udpEnabled = udpEnabled;
config.inbound[0].sniffingEnabled = sniffingEnabled; config.inbound[0].sniffingEnabled = sniffingEnabled;
config.inbound[0].allowLANConn = allowLANConn;
config.inbound[0].user = txtuser.Text;
config.inbound[0].pass = txtpass.Text;
//本地监听2 if (config.inbound.Count > 1)
string localPort2 = txtlocalPort2.Text.TrimEx();
string protocol2 = cmbprotocol2.Text.TrimEx();
bool udpEnabled2 = chkudpEnabled2.Checked;
bool sniffingEnabled2 = chksniffingEnabled2.Checked;
if (chkAllowIn2.Checked)
{ {
if (Utils.IsNullOrEmpty(localPort2) || !Utils.IsNumberic(localPort2)) config.inbound.RemoveAt(1);
{
UI.Show(UIRes.I18N("FillLocalListeningPort"));
return -1;
}
if (Utils.IsNullOrEmpty(protocol2))
{
UI.Show(UIRes.I18N("PleaseSelectProtocol"));
return -1;
}
if (config.inbound.Count < 2)
{
config.inbound.Add(new Mode.InItem());
}
config.inbound[1].localPort = Utils.ToInt(localPort2);
config.inbound[1].protocol = protocol2;
config.inbound[1].udpEnabled = udpEnabled2;
config.inbound[1].sniffingEnabled = sniffingEnabled2;
}
else
{
if (config.inbound.Count > 1)
{
config.inbound.RemoveAt(1);
}
} }
//日志 //日志
config.logEnabled = logEnabled; config.logEnabled = logEnabled;
config.loglevel = loglevel; config.loglevel = loglevel;
@@ -312,7 +276,7 @@ namespace v2rayN.Forms
|| Utils.IsNullOrEmpty(readBufferSize) || !Utils.IsNumberic(readBufferSize) || Utils.IsNullOrEmpty(readBufferSize) || !Utils.IsNumberic(readBufferSize)
|| Utils.IsNullOrEmpty(writeBufferSize) || !Utils.IsNumberic(writeBufferSize)) || Utils.IsNullOrEmpty(writeBufferSize) || !Utils.IsNumberic(writeBufferSize))
{ {
UI.Show(UIRes.I18N("FillKcpParameters")); UI.Show(ResUI.FillKcpParameters);
return -1; return -1;
} }
config.kcpItem.mtu = Utils.ToInt(mtu); config.kcpItem.mtu = Utils.ToInt(mtu);
@@ -335,8 +299,6 @@ namespace v2rayN.Forms
//开机自动启动 //开机自动启动
Utils.SetAutoRun(chkAutoRun.Checked); Utils.SetAutoRun(chkAutoRun.Checked);
config.allowLANConn = chkAllowLANConn.Checked;
bool lastEnableStatistics = config.enableStatistics; bool lastEnableStatistics = config.enableStatistics;
config.enableStatistics = chkEnableStatistics.Checked; config.enableStatistics = chkEnableStatistics.Checked;
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue; config.statisticsFreshRate = (int)cbFreshrate.SelectedValue;
@@ -344,6 +306,7 @@ namespace v2rayN.Forms
config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked; config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked;
config.autoUpdateInterval = Utils.ToInt(txtautoUpdateInterval.Text); config.autoUpdateInterval = Utils.ToInt(txtautoUpdateInterval.Text);
config.autoUpdateSubInterval = Utils.ToInt(txtautoUpdateSubInterval.Text);
config.uiItem.enableAutoAdjustMainLvColWidth = chkEnableAutoAdjustMainLvColWidth.Checked; config.uiItem.enableAutoAdjustMainLvColWidth = chkEnableAutoAdjustMainLvColWidth.Checked;
config.enableSecurityProtocolTls13 = chkEnableSecurityProtocolTls13.Checked; config.enableSecurityProtocolTls13 = chkEnableSecurityProtocolTls13.Checked;
@@ -366,17 +329,6 @@ namespace v2rayN.Forms
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
} }
private void chkAllowIn2_CheckedChanged(object sender, EventArgs e)
{
chkAllowIn2State();
}
private void chkAllowIn2State()
{
bool blAllow2 = chkAllowIn2.Checked;
txtlocalPort2.Enabled =
cmbprotocol2.Enabled =
chkudpEnabled2.Enabled = blAllow2;
}
private void linkDnsObjectDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) private void linkDnsObjectDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{ {
@@ -387,5 +339,6 @@ namespace v2rayN.Forms
{ {
Process.Start(Utils.GetPath("EnableLoopback.exe")); Process.Start(Utils.GetPath("EnableLoopback.exe"));
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -121,17 +121,47 @@
<value>取消(&amp;C)</value> <value>取消(&amp;C)</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 469</value>
</data>
<data name="tabPage1.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>648, 437</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label16.Text" xml:space="preserve">
<value>认证密码</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>219, 65</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>认证用户名</value>
</data>
<data name="chkdefAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 208</value>
</data>
<data name="chkdefAllowInsecure.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkdefAllowInsecure.Size" type="System.Drawing.Size, System.Drawing">
<value>324, 16</value> <value>324, 16</value>
</data> </data>
<data name="chkdefAllowInsecure.Text" xml:space="preserve"> <data name="chkdefAllowInsecure.Text" xml:space="preserve">
<value>传输层安全选tls时默认跳过证书验证(allowInsecure)</value> <value>传输层安全选tls时默认跳过证书验证(allowInsecure)</value>
</data> </data>
<data name="chksniffingEnabled2.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkAllowLANConn.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 16</value> <value>144, 16</value>
</data> </data>
<data name="chksniffingEnabled2.Text" xml:space="preserve"> <data name="chkAllowLANConn.Text" xml:space="preserve">
<value>开启流量探测</value> <value>允许来自局域网的连接</value>
</data> </data>
<data name="chksniffingEnabled.Size" type="System.Drawing.Size, System.Drawing"> <data name="chksniffingEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 16</value> <value>96, 16</value>
@@ -139,29 +169,17 @@
<data name="chksniffingEnabled.Text" xml:space="preserve"> <data name="chksniffingEnabled.Text" xml:space="preserve">
<value>开启流量探测</value> <value>开启流量探测</value>
</data> </data>
<data name="chkmuxEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 145</value>
</data>
<data name="chkmuxEnabled.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkmuxEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>114, 16</value> <value>114, 16</value>
</data> </data>
<data name="chkmuxEnabled.Text" xml:space="preserve"> <data name="chkmuxEnabled.Text" xml:space="preserve">
<value>开启Mux多路复用</value> <value>开启Mux多路复用</value>
</data> </data>
<data name="chkAllowIn2.Size" type="System.Drawing.Size, System.Drawing"> <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>102, 16</value> <value>219, 29</value>
</data>
<data name="chkAllowIn2.Text" xml:space="preserve">
<value>本地监听端口2</value>
</data>
<data name="chkudpEnabled2.Size" type="System.Drawing.Size, System.Drawing">
<value>66, 16</value>
</data>
<data name="chkudpEnabled2.Text" xml:space="preserve">
<value>开启UDP</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>协议</value>
</data> </data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing"> <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value> <value>29, 12</value>
@@ -175,12 +193,21 @@
<data name="chkudpEnabled.Text" xml:space="preserve"> <data name="chkudpEnabled.Text" xml:space="preserve">
<value>开启UDP</value> <value>开启UDP</value>
</data> </data>
<data name="chklogEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 176</value>
</data>
<data name="chklogEnabled.Size" type="System.Drawing.Size, System.Drawing"> <data name="chklogEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 16</value> <value>156, 16</value>
</data> </data>
<data name="chklogEnabled.Text" xml:space="preserve"> <data name="chklogEnabled.Text" xml:space="preserve">
<value>记录本地日志(默认关闭)</value> <value>记录本地日志(默认关闭)</value>
</data> </data>
<data name="cmbloglevel.Location" type="System.Drawing.Point, System.Drawing">
<value>257, 174</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>193, 178</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing"> <data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value> <value>53, 12</value>
</data> </data>
@@ -193,14 +220,11 @@
<data name="label2.Text" xml:space="preserve"> <data name="label2.Text" xml:space="preserve">
<value>本地监听端口</value> <value>本地监听端口</value>
</data> </data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>648, 437</value>
</data>
<data name="tabPage1.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value> <value>654, 443</value>
</data> </data>
<data name="tabPage1.Text" xml:space="preserve"> <data name="tabPage2.Text" xml:space="preserve">
<value> Core:基础设置 </value> <value> Core:DNS设置 </value>
</data> </data>
<data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing"> <data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>161, 12</value> <value>161, 12</value>
@@ -214,18 +238,27 @@
<data name="label14.Text" xml:space="preserve"> <data name="label14.Text" xml:space="preserve">
<value>自定义DNS(可多个,用逗号(,)隔开)</value> <value>自定义DNS(可多个,用逗号(,)隔开)</value>
</data> </data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value> Core:DNS设置 </value>
</data>
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value> <value>654, 443</value>
</data> </data>
<data name="tabPage6.Text" xml:space="preserve"> <data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </value> <value> Core:KCP设置 </value>
</data> </data>
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="txtautoUpdateSubInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 159</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>自动更新订阅的间隔(单位小时)</value>
</data>
<data name="chkEnableSecurityProtocolTls13.Text" xml:space="preserve"> <data name="chkEnableSecurityProtocolTls13.Text" xml:space="preserve">
<value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value> <value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value>
</data> </data>
@@ -239,7 +272,7 @@
<value>解除Windows10 UWP应用回环代理限制</value> <value>解除Windows10 UWP应用回环代理限制</value>
</data> </data>
<data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing"> <data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>255, 156</value> <value>248, 134</value>
</data> </data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing"> <data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value> <value>191, 12</value>
@@ -253,12 +286,6 @@
<data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve"> <data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve">
<value>更新Core时忽略Geo文件</value> <value>更新Core时忽略Geo文件</value>
</data> </data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>Core类型</value>
</data>
<data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 16</value> <value>156, 16</value>
</data> </data>
@@ -277,23 +304,29 @@
<data name="chkEnableStatistics.Text" xml:space="preserve"> <data name="chkEnableStatistics.Text" xml:space="preserve">
<value>启用统计(实时网速显示和使用流量显示需要重启v2rayN客户端)</value> <value>启用统计(实时网速显示和使用流量显示需要重启v2rayN客户端)</value>
</data> </data>
<data name="chkAllowLANConn.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 16</value>
</data>
<data name="chkAllowLANConn.Text" xml:space="preserve">
<value>允许来自局域网的连接</value>
</data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 16</value> <value>180, 16</value>
</data> </data>
<data name="chkAutoRun.Text" xml:space="preserve"> <data name="chkAutoRun.Text" xml:space="preserve">
<value>开机自动启动(可能会不成功)</value> <value>开机自动启动(可能会不成功)</value>
</data> </data>
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabPageCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value> <value>654, 443</value>
</data> </data>
<data name="tabPage7.Text" xml:space="preserve"> <data name="tabPageCoreType.Text" xml:space="preserve">
<value> v2rayN设置 </value> <value> Core类型设置 </value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 系统代理设置 </value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>例外</value>
</data> </data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing"> <data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value> <value>95, 12</value>
@@ -307,26 +340,17 @@
<data name="label12.Text" xml:space="preserve"> <data name="label12.Text" xml:space="preserve">
<value>对于下列字符开头的地址不使用代理服务器:</value> <value>对于下列字符开头的地址不使用代理服务器:</value>
</data> </data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing"> <data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>654, 443</value> <value>0, 479</value>
</data> </data>
<data name="groupBox2.Text" xml:space="preserve"> <data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>例外</value> <value>662, 60</value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 系统代理设置 </value>
</data>
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 469</value>
</data> </data>
<data name="btnOK.Text" xml:space="preserve"> <data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value> <value>确定(&amp;O)</value>
</data> </data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing"> <data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 479</value> <value>662, 10</value>
</data> </data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>662, 539</value> <value>662, 539</value>
@@ -334,7 +358,4 @@
<data name="$this.Text" xml:space="preserve"> <data name="$this.Text" xml:space="preserve">
<value>参数设置</value> <value>参数设置</value>
</data> </data>
<data name="tabPageCoreType.Text" xml:space="preserve">
<value> Core类型设置 </value>
</data>
</root> </root>

View File

@@ -4,6 +4,7 @@ using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -47,8 +48,8 @@ namespace v2rayN.Forms
} }
rulesItem.inboundTag = inboundTag; rulesItem.inboundTag = inboundTag;
rulesItem.outboundTag = cmbOutboundTag.Text; rulesItem.outboundTag = cmbOutboundTag.Text;
rulesItem.domain = Utils.String2List(txtDomain.Text); rulesItem.domain = Utils.String2ListSorted(txtDomain.Text);
rulesItem.ip = Utils.String2List(txtIP.Text); rulesItem.ip = Utils.String2ListSorted(txtIP.Text);
var protocol = new List<string>(); var protocol = new List<string>();
for (int i = 0; i < clbProtocol.Items.Count; i++) for (int i = 0; i < clbProtocol.Items.Count; i++)
@@ -125,7 +126,7 @@ namespace v2rayN.Forms
} }
if (!hasRule) if (!hasRule)
{ {
UI.ShowWarning(string.Format(UIRes.I18N("RoutingRuleDetailRequiredTips"), "Port/Protocol/Domain/IP")); UI.ShowWarning(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Port/Protocol/Domain/IP"));
return; return;
} }
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;

View File

@@ -1,9 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -114,7 +116,7 @@ namespace v2rayN.Forms
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("OperationFailed")); UI.ShowWarning(ResUI.OperationFailed);
} }
} }
@@ -154,7 +156,7 @@ namespace v2rayN.Forms
{ {
if (lvRoutings.SelectedIndices.Count <= 0) if (lvRoutings.SelectedIndices.Count <= 0)
{ {
UI.Show(UIRes.I18N("PleaseSelectRules")); UI.Show(ResUI.PleaseSelectRules);
return index; return index;
} }
@@ -198,7 +200,7 @@ namespace v2rayN.Forms
int index = GetLvSelectedIndex(); int index = GetLvSelectedIndex();
if (index < 0) if (index < 0)
{ {
UI.Show(UIRes.I18N("PleaseSelectRules")); UI.Show(ResUI.PleaseSelectRules);
return; return;
} }
if (ConfigHandler.MoveRoutingRule(ref routingItem, index, eMove) == 0) if (ConfigHandler.MoveRoutingRule(ref routingItem, index, eMove) == 0)
@@ -232,7 +234,7 @@ namespace v2rayN.Forms
{ {
return; return;
} }
if (UI.ShowYesNo(UIRes.I18N("RemoveRules")) == DialogResult.No) if (UI.ShowYesNo(ResUI.RemoveRules) == DialogResult.No)
{ {
return; return;
} }
@@ -253,7 +255,7 @@ namespace v2rayN.Forms
if (lst.Count > 0) if (lst.Count > 0)
{ {
Utils.SetClipboardData(Utils.ToJson(lst)); Utils.SetClipboardData(Utils.ToJson(lst));
//UI.Show(UIRes.I18N("OperationSuccess")); //UI.Show(ResUI.OperationSuccess"));
} }
} }
@@ -323,7 +325,7 @@ namespace v2rayN.Forms
if (AddBatchRoutingRules(ref routingItem, result) == 0) if (AddBatchRoutingRules(ref routingItem, result) == 0)
{ {
RefreshRoutingsView(); RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess")); UI.Show(ResUI.OperationSuccess);
} }
} }
@@ -333,7 +335,7 @@ namespace v2rayN.Forms
if (AddBatchRoutingRules(ref routingItem, clipboardData) == 0) if (AddBatchRoutingRules(ref routingItem, clipboardData) == 0)
{ {
RefreshRoutingsView(); RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess")); UI.Show(ResUI.OperationSuccess);
} }
} }
private void menuImportRulesFromUrl_Click(object sender, EventArgs e) private void menuImportRulesFromUrl_Click(object sender, EventArgs e)
@@ -341,29 +343,31 @@ namespace v2rayN.Forms
var url = txtUrl.Text.Trim(); var url = txtUrl.Text.Trim();
if (Utils.IsNullOrEmpty(url)) if (Utils.IsNullOrEmpty(url))
{ {
UI.Show(UIRes.I18N("MsgNeedUrl")); UI.Show(ResUI.MsgNeedUrl);
return; return;
} }
DownloadHandle downloadHandle = new DownloadHandle();
string clipboardData = downloadHandle.WebDownloadStringSync(url); Task.Run(async () =>
if (AddBatchRoutingRules(ref routingItem, clipboardData) == 0)
{ {
RefreshRoutingsView(); DownloadHandle downloadHandle = new DownloadHandle();
UI.Show(UIRes.I18N("OperationSuccess")); string result = await downloadHandle.DownloadStringAsync(url, false, "");
} if (AddBatchRoutingRules(ref routingItem, result) == 0)
{
RefreshRoutingsView();
UI.Show(ResUI.OperationSuccess);
}
});
} }
private int AddBatchRoutingRules(ref RoutingItem routingItem, string clipboardData) private int AddBatchRoutingRules(ref RoutingItem routingItem, string clipboardData)
{ {
bool blReplace = false; bool blReplace = false;
if (UI.ShowYesNo(UIRes.I18N("AddBatchRoutingRulesYesNo")) == DialogResult.No) if (UI.ShowYesNo(ResUI.AddBatchRoutingRulesYesNo) == DialogResult.No)
{ {
blReplace = true; blReplace = true;
} }
return ConfigHandler.AddBatchRoutingRules(ref routingItem, clipboardData, blReplace); return ConfigHandler.AddBatchRoutingRules(ref routingItem, clipboardData, blReplace);
} }
#endregion #endregion
} }

View File

@@ -4,6 +4,7 @@ using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -61,7 +62,7 @@ namespace v2rayN.Forms
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("OperationFailed")); UI.ShowWarning(ResUI.OperationFailed);
} }
} }
@@ -144,10 +145,10 @@ namespace v2rayN.Forms
lvRoutings.HeaderStyle = ColumnHeaderStyle.Clickable; lvRoutings.HeaderStyle = ColumnHeaderStyle.Clickable;
lvRoutings.Columns.Add("", 30); lvRoutings.Columns.Add("", 30);
lvRoutings.Columns.Add(UIRes.I18N("LvAlias"), 200); lvRoutings.Columns.Add(ResUI.LvAlias, 200);
lvRoutings.Columns.Add(UIRes.I18N("LvCount"), 60); lvRoutings.Columns.Add(ResUI.LvCount, 60);
lvRoutings.Columns.Add(UIRes.I18N("LvUrl"), 240); lvRoutings.Columns.Add(ResUI.LvUrl, 240);
lvRoutings.Columns.Add(UIRes.I18N("LvCustomIcon"), 240); lvRoutings.Columns.Add(ResUI.LvCustomIcon, 240);
lvRoutings.EndUpdate(); lvRoutings.EndUpdate();
} }
@@ -211,7 +212,7 @@ namespace v2rayN.Forms
{ {
if (lvRoutings.SelectedIndices.Count <= 0) if (lvRoutings.SelectedIndices.Count <= 0)
{ {
UI.Show(UIRes.I18N("PleaseSelectRules")); UI.Show(ResUI.PleaseSelectRules);
return index; return index;
} }
@@ -259,7 +260,7 @@ namespace v2rayN.Forms
{ {
return; return;
} }
if (UI.ShowYesNo(UIRes.I18N("RemoveRules")) == DialogResult.No) if (UI.ShowYesNo(ResUI.RemoveRules) == DialogResult.No)
{ {
return; return;
} }
@@ -282,7 +283,7 @@ namespace v2rayN.Forms
{ {
if (index < 0) if (index < 0)
{ {
UI.Show(UIRes.I18N("PleaseSelectServer")); UI.Show(ResUI.PleaseSelectServer);
return -1; return -1;
} }
if (ConfigHandler.SetDefaultRouting(ref config, index) == 0) if (ConfigHandler.SetDefaultRouting(ref config, index) == 0)
@@ -301,7 +302,7 @@ namespace v2rayN.Forms
txtBlockDomain.Text = "geosite:category-ads-all"; txtBlockDomain.Text = "geosite:category-ads-all";
UI.Show(UIRes.I18N("OperationSuccess")); UI.Show(ResUI.OperationSuccess);
} }
private void menuImportAdvancedRules_Click(object sender, EventArgs e) private void menuImportAdvancedRules_Click(object sender, EventArgs e)

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -156,34 +157,34 @@ namespace v2rayN.Forms
if (network.Equals(Global.DefaultNetwork)) if (network.Equals(Global.DefaultNetwork))
{ {
tipRequestHost.Text = UIRes.I18N("TransportRequestHostTip1"); tipRequestHost.Text = ResUI.TransportRequestHostTip1;
tipHeaderType.Text = UIRes.I18N("TransportHeaderTypeTip1"); tipHeaderType.Text = ResUI.TransportHeaderTypeTip1;
} }
else if (network.Equals("kcp")) else if (network.Equals("kcp"))
{ {
tipHeaderType.Text = UIRes.I18N("TransportHeaderTypeTip2"); tipHeaderType.Text = ResUI.TransportHeaderTypeTip2;
tipPath.Text = UIRes.I18N("TransportPathTip5"); tipPath.Text = ResUI.TransportPathTip5;
} }
else if (network.Equals("ws")) else if (network.Equals("ws"))
{ {
tipRequestHost.Text = UIRes.I18N("TransportRequestHostTip2"); tipRequestHost.Text = ResUI.TransportRequestHostTip2;
tipPath.Text = UIRes.I18N("TransportPathTip1"); tipPath.Text = ResUI.TransportPathTip1;
} }
else if (network.Equals("h2")) else if (network.Equals("h2"))
{ {
tipRequestHost.Text = UIRes.I18N("TransportRequestHostTip3"); tipRequestHost.Text = ResUI.TransportRequestHostTip3;
tipPath.Text = UIRes.I18N("TransportPathTip2"); tipPath.Text = ResUI.TransportPathTip2;
} }
else if (network.Equals("quic")) else if (network.Equals("quic"))
{ {
tipRequestHost.Text = UIRes.I18N("TransportRequestHostTip4"); tipRequestHost.Text = ResUI.TransportRequestHostTip4;
tipPath.Text = UIRes.I18N("TransportPathTip3"); tipPath.Text = ResUI.TransportPathTip3;
tipHeaderType.Text = UIRes.I18N("TransportHeaderTypeTip3"); tipHeaderType.Text = ResUI.TransportHeaderTypeTip3;
} }
else if (network.Equals("grpc")) else if (network.Equals("grpc"))
{ {
tipPath.Text = UIRes.I18N("TransportPathTip4"); tipPath.Text = ResUI.TransportPathTip4;
tipHeaderType.Text = UIRes.I18N("TransportHeaderTypeTip4"); tipHeaderType.Text = ResUI.TransportHeaderTypeTip4;
labHeaderType.Visible = false; labHeaderType.Visible = false;
} }
} }

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
@@ -74,7 +75,7 @@ namespace v2rayN.Forms
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("OperationFailed")); UI.ShowWarning(ResUI.OperationFailed);
} }
} }

View File

@@ -15,7 +15,9 @@ namespace v2rayN
public const string xrayCoreUrl = "https://github.com/XTLS/Xray-core/releases"; public const string xrayCoreUrl = "https://github.com/XTLS/Xray-core/releases";
public const string NUrl = @"https://github.com/2dust/v2rayN/releases"; public const string NUrl = @"https://github.com/2dust/v2rayN/releases";
public const string clashCoreUrl = "https://github.com/Dreamacro/clash/releases"; public const string clashCoreUrl = "https://github.com/Dreamacro/clash/releases";
public const string clashMetaCoreUrl = "https://github.com/MetaCubeX/Clash.Meta/releases";
public const string hysteriaCoreUrl = "https://github.com/HyNetwork/hysteria/releases"; public const string hysteriaCoreUrl = "https://github.com/HyNetwork/hysteria/releases";
public const string naiveproxyCoreUrl = "https://github.com/klzgrad/naiveproxy/releases";
@@ -64,9 +66,10 @@ namespace v2rayN
/// </summary> /// </summary>
public const string v2raySampleHttpresponseFileName = "v2rayN.Sample.SampleHttpresponse.txt"; public const string v2raySampleHttpresponseFileName = "v2rayN.Sample.SampleHttpresponse.txt";
public const string CustomRoutingFileName = "v2rayN.Sample.custom_routing_"; public const string CustomRoutingFileName = "v2rayN.Sample.custom_routing_";
public const string v2raySampleInbound = "v2rayN.Sample.SampleInbound.txt";
/// <summary> /// <summary>
/// 默认加密方式 /// 默认加密方式
@@ -111,6 +114,8 @@ namespace v2rayN
public const string InboundSocks = "socks"; public const string InboundSocks = "socks";
public const string InboundHttp = "http"; public const string InboundHttp = "http";
public const string InboundSocks2 = "socks2";
public const string InboundHttp2 = "http2";
public const string Loopback = "127.0.0.1"; public const string Loopback = "127.0.0.1";
public const string InboundAPITagName = "api"; public const string InboundAPITagName = "api";
public const string InboundAPIProtocal = "dokodemo-door"; public const string InboundAPIProtocal = "dokodemo-door";
@@ -219,31 +224,6 @@ namespace v2rayN
get; set; get; set;
} }
/// <summary>
/// 是否开启全局代理(http)
/// </summary>
public static bool sysAgent
{
get; set;
}
/// <summary>
/// socks端口
/// </summary>
public static int socksPort
{
get; set;
}
/// <summary>
/// http端口
/// </summary>
public static int httpPort
{
get; set;
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>

View File

@@ -15,7 +15,7 @@ namespace v2rayN.Handler
class ConfigHandler class ConfigHandler
{ {
private static string configRes = Global.ConfigFileName; private static string configRes = Global.ConfigFileName;
private static object objLock = new object(); private static readonly object objLock = new object();
#region ConfigHandler #region ConfigHandler
@@ -747,6 +747,10 @@ namespace v2rayN.Handler
{ {
vmessItem.indexId = Utils.GetGUID(false); vmessItem.indexId = Utils.GetGUID(false);
} }
else if (vmessItem.indexId == config.indexId)
{
Global.reloadV2ray = true;
}
if (!config.vmess.Exists(it => it.indexId == vmessItem.indexId)) if (!config.vmess.Exists(it => it.indexId == vmessItem.indexId))
{ {
var maxSort = config.vmess.Any() ? config.vmess.Max(t => t.sort) : 0; var maxSort = config.vmess.Any() ? config.vmess.Max(t => t.sort) : 0;
@@ -755,11 +759,6 @@ namespace v2rayN.Handler
config.vmess.Add(vmessItem); config.vmess.Add(vmessItem);
} }
//if (config.vmess.Count == 1)
//{
// config.indexId = config.vmess[0].indexId;
// Global.reloadV2ray = true;
//}
return 0; return 0;
} }
@@ -940,10 +939,10 @@ namespace v2rayN.Handler
vmessItem.coreType = ECoreType.clash; vmessItem.coreType = ECoreType.clash;
vmessItem.address = fileName; vmessItem.address = fileName;
vmessItem.remarks = "clash_custom"; vmessItem.remarks = "clash_custom";
} }
//Is Other configuration //Is Other configuration
else else
{ {
var fileName = Utils.GetTempPath($"{Utils.GetGUID(false)}.txt"); var fileName = Utils.GetTempPath($"{Utils.GetGUID(false)}.txt");
File.WriteAllText(fileName, clipboardData); File.WriteAllText(fileName, clipboardData);
@@ -1160,6 +1159,8 @@ namespace v2rayN.Handler
{ {
config.uiItem.mainLvColWidth.Add(name, width); config.uiItem.mainLvColWidth.Add(name, width);
} }
ToJsonFile(config);
return 0; return 0;
} }
public static int GetformMainLvColWidth(ref Config config, string name, int width) public static int GetformMainLvColWidth(ref Config config, string name, int width)

View File

@@ -1,8 +1,14 @@
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Resx;
namespace v2rayN.Handler namespace v2rayN.Handler
{ {
@@ -28,97 +34,71 @@ namespace v2rayN.Handler
} }
} }
private int progressPercentage = -1; public async Task<int> DownloadDataAsync(string url, WebProxy webProxy, int downloadTimeout)
private long totalBytesToReceive = 0;
private DateTime totalDatetime = new DateTime();
private int DownloadTimeout = -1;
public WebClientEx DownloadFileAsync(string url, WebProxy webProxy, int downloadTimeout)
{ {
WebClientEx ws = new WebClientEx();
try try
{ {
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13); Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13);
UpdateCompleted?.Invoke(this, new ResultEventArgs(false, UIRes.I18N("Downloading"))); UpdateCompleted?.Invoke(this, new ResultEventArgs(false, ResUI.Speedtesting));
progressPercentage = -1; var client = new HttpClient(new WebRequestHandler()
totalBytesToReceive = 0;
//WebClientEx ws = new WebClientEx();
DownloadTimeout = downloadTimeout;
if (webProxy != null)
{ {
ws.Proxy = webProxy;// new WebProxy(Global.Loopback, Global.httpPort); Proxy = webProxy
} });
ws.DownloadFileCompleted += ws_DownloadFileCompleted; var progress = new Progress<double>();
ws.DownloadProgressChanged += ws_DownloadProgressChanged; progress.ProgressChanged += (sender, value) =>
ws.DownloadFileAsync(new Uri(url), Utils.GetPath(Utils.GetDownloadFileName(url))); {
if (UpdateCompleted != null)
{
string msg = string.Format("{0} M/s", value.ToString("#0.0")).PadLeft(9, ' ');
UpdateCompleted(this, new ResultEventArgs(false, msg));
}
};
var cancellationToken = new CancellationTokenSource();
cancellationToken.CancelAfter(downloadTimeout * 1000);
await HttpClientHelper.GetInstance().DownloadDataAsync4Speed(client,
url,
progress,
cancellationToken.Token);
} }
catch (Exception ex) catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex); //Utils.SaveLog(ex.Message, ex);
Error?.Invoke(this, new ErrorEventArgs(ex)); Error?.Invoke(this, new ErrorEventArgs(ex));
} }
return ws; return 0;
} }
void ws_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) public void DownloadFileAsync(string url, bool blProxy, int downloadTimeout)
{
if (UpdateCompleted != null)
{
if (totalBytesToReceive == 0)
{
totalDatetime = DateTime.Now;
totalBytesToReceive = e.BytesReceived;
return;
}
totalBytesToReceive = e.BytesReceived;
if (DownloadTimeout != -1)
{
if ((DateTime.Now - totalDatetime).TotalSeconds > DownloadTimeout)
{
((WebClientEx)sender).CancelAsync();
}
}
if (progressPercentage != e.ProgressPercentage && e.ProgressPercentage % 10 == 0)
{
progressPercentage = e.ProgressPercentage;
string msg = string.Format("...{0}%", e.ProgressPercentage);
UpdateCompleted(this, new ResultEventArgs(false, msg));
}
}
}
void ws_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{ {
try try
{ {
if (UpdateCompleted != null) Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13);
{ UpdateCompleted?.Invoke(this, new ResultEventArgs(false, ResUI.Downloading));
if (e.Cancelled)
{
((WebClientEx)sender).Dispose();
TimeSpan ts = (DateTime.Now - totalDatetime);
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.0"));
UpdateCompleted(this, new ResultEventArgs(true, speed.PadLeft(8, ' ')));
return;
}
if (e.Error == null var client = new HttpClient(new WebRequestHandler()
|| Utils.IsNullOrEmpty(e.Error.ToString())) {
Proxy = GetWebProxy(blProxy)
});
var progress = new Progress<double>();
progress.ProgressChanged += (sender, value) =>
{
if (UpdateCompleted != null)
{ {
((WebClientEx)sender).Dispose(); string msg = string.Format("...{0}%", value);
TimeSpan ts = (DateTime.Now - totalDatetime); UpdateCompleted(this, new ResultEventArgs(value > 100 ? true : false, msg));
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.0"));
UpdateCompleted(this, new ResultEventArgs(true, speed.PadLeft(8, ' ')));
} }
else };
{
throw e.Error; var cancellationToken = new CancellationTokenSource();
} _ = HttpClientHelper.GetInstance().DownloadFileAsync(client,
} url,
Utils.GetPath(Utils.GetDownloadFileName(url)),
progress,
cancellationToken.Token);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -128,115 +108,139 @@ namespace v2rayN.Handler
} }
} }
public async Task<string> UrlRedirectAsync(string url, bool blProxy)
{
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13);
WebRequestHandler webRequestHandler = new WebRequestHandler
{
AllowAutoRedirect = false,
Proxy = GetWebProxy(blProxy)
};
HttpClient client = new HttpClient(webRequestHandler);
HttpResponseMessage response = await client.GetAsync(url);
if (response.StatusCode.ToString() == "Redirect")
{
return response.Headers.Location.ToString();
}
else
{
Utils.SaveLog("StatusCode error: " + url);
return null;
}
}
/// <summary> /// <summary>
/// DownloadString /// DownloadString
/// </summary> /// </summary>
/// <param name="url"></param> /// <param name="url"></param>
public void WebDownloadString(string url, WebProxy webProxy, string userAgent) public async Task<string> DownloadStringAsync(string url, bool blProxy, string userAgent)
{ {
string source = string.Empty;
try try
{ {
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13); Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13);
var client = new HttpClient(new WebRequestHandler()
WebClientEx ws = new WebClientEx();
ws.Encoding = Encoding.UTF8;
if (webProxy != null)
{ {
ws.Proxy = webProxy; Proxy = GetWebProxy(blProxy)
} });
if (Utils.IsNullOrEmpty(userAgent)) if (Utils.IsNullOrEmpty(userAgent))
{ {
userAgent = $"{Utils.GetVersion(false)}"; userAgent = $"{Utils.GetVersion(false)}";
} }
ws.Headers.Add("user-agent", userAgent); client.DefaultRequestHeaders.UserAgent.TryParseAdd(userAgent);
Uri uri = new Uri(url); Uri uri = new Uri(url);
//Authorization Header //Authorization Header
if (!Utils.IsNullOrEmpty(uri.UserInfo)) if (!Utils.IsNullOrEmpty(uri.UserInfo))
{ {
ws.Headers.Add(HttpRequestHeader.Authorization, "Basic " + Utils.Base64Encode(uri.UserInfo)); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Utils.Base64Encode(uri.UserInfo));
} }
var result = await HttpClientHelper.GetInstance().GetAsync(client, url);
ws.DownloadStringCompleted += Ws_DownloadStringCompleted; return result;
ws.DownloadStringAsync(uri);
} }
catch (Exception ex) catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex); Utils.SaveLog(ex.Message, ex);
} }
return null;
} }
private void Ws_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) public int RunAvailabilityCheck(WebProxy webProxy)
{ {
try try
{ {
if (e.Error == null if (webProxy == null)
|| Utils.IsNullOrEmpty(e.Error.ToString()))
{ {
string source = e.Result; var httpPort = LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp);
UpdateCompleted?.Invoke(this, new ResultEventArgs(true, source)); webProxy = new WebProxy(Global.Loopback, httpPort);
} }
else
try
{ {
throw e.Error; string status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out int responseTime);
bool noError = Utils.IsNullOrEmpty(status);
return noError ? responseTime : -1;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return -1;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex); Utils.SaveLog(ex.Message, ex);
return -1;
Error?.Invoke(this, new ErrorEventArgs(ex));
} }
} }
public string WebDownloadStringSync(string url) public string GetRealPingTime(string url, WebProxy webProxy, out int responseTime)
{ {
string source = string.Empty; string msg = string.Empty;
responseTime = -1;
try try
{ {
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13); HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
myHttpWebRequest.Timeout = 5000;
myHttpWebRequest.Proxy = webProxy;
WebClientEx ws = new WebClientEx(); Stopwatch timer = new Stopwatch();
ws.Encoding = Encoding.UTF8; timer.Start();
return ws.DownloadString(new Uri(url));
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
if (myHttpWebResponse.StatusCode != HttpStatusCode.OK
&& myHttpWebResponse.StatusCode != HttpStatusCode.NoContent)
{
msg = myHttpWebResponse.StatusDescription;
}
timer.Stop();
responseTime = timer.Elapsed.Milliseconds;
myHttpWebResponse.Close();
} }
catch (Exception ex) catch (Exception ex)
{ {
Utils.SaveLog(ex.Message, ex); Utils.SaveLog(ex.Message, ex);
return string.Empty; msg = ex.Message;
} }
return msg;
} }
public WebClientEx DownloadDataAsync(string url, WebProxy webProxy, int downloadTimeout) private WebProxy GetWebProxy(bool blProxy)
{ {
WebClientEx ws = new WebClientEx(); if (!blProxy)
try
{ {
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13); return null;
UpdateCompleted?.Invoke(this, new ResultEventArgs(false, UIRes.I18N("Downloading")));
progressPercentage = -1;
totalBytesToReceive = 0;
DownloadTimeout = downloadTimeout;
if (webProxy != null)
{
ws.Proxy = webProxy;
}
ws.DownloadProgressChanged += ws_DownloadProgressChanged;
ws.DownloadDataCompleted += ws_DownloadFileCompleted;
ws.DownloadDataAsync(new Uri(url));
} }
catch (Exception ex) var httpPort = LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp);
var webProxy = new WebProxy(Global.Loopback, httpPort);
if (RunAvailabilityCheck(webProxy) > 0)
{ {
Utils.SaveLog(ex.Message, ex); return webProxy;
Error?.Invoke(this, new ErrorEventArgs(ex));
} }
return ws;
return null;
} }
} }
} }

View File

@@ -71,8 +71,8 @@ namespace v2rayN.Handler
coreType = ECoreType.v2fly, coreType = ECoreType.v2fly,
coreExes = new List<string> { "wv2ray", "v2ray" }, coreExes = new List<string> { "wv2ray", "v2ray" },
arguments = "", arguments = "",
coreUrl = Global.v2flyCoreUrl coreUrl = Global.v2flyCoreUrl,
match = "V2Ray"
}); });
coreInfos.Add(new CoreInfo coreInfos.Add(new CoreInfo
@@ -80,17 +80,26 @@ namespace v2rayN.Handler
coreType = ECoreType.Xray, coreType = ECoreType.Xray,
coreExes = new List<string> { "xray" }, coreExes = new List<string> { "xray" },
arguments = "", arguments = "",
coreUrl = Global.xrayCoreUrl coreUrl = Global.xrayCoreUrl,
match = "Xray"
}); });
coreInfos.Add(new CoreInfo coreInfos.Add(new CoreInfo
{ {
coreType = ECoreType.clash, coreType = ECoreType.clash,
coreExes = new List<string> { "clash-windows-amd64", "clash-windows-386", "clash" }, coreExes = new List<string> { "clash-windows-amd64-v3", "clash-windows-amd64", "clash-windows-386", "clash" },
arguments = "-f config.json", arguments = "-f config.json",
coreUrl = Global.clashCoreUrl coreUrl = Global.clashCoreUrl
}); });
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.clash_meta,
coreExes = new List<string> { "Clash.Meta-windows-amd64v1", "Clash.Meta-windows-amd64", "Clash.Meta-windows-386", "Clash.Meta", "clash" },
arguments = "-f config.json",
coreUrl = Global.clashMetaCoreUrl
});
coreInfos.Add(new CoreInfo coreInfos.Add(new CoreInfo
{ {
coreType = ECoreType.hysteria, coreType = ECoreType.hysteria,
@@ -98,6 +107,14 @@ namespace v2rayN.Handler
arguments = "", arguments = "",
coreUrl = Global.hysteriaCoreUrl coreUrl = Global.hysteriaCoreUrl
}); });
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.naiveproxy,
coreExes = new List<string> { "naiveproxy", "naive" },
arguments = "config.json",
coreUrl = Global.naiveproxyCoreUrl
});
} }
} }

View File

@@ -9,6 +9,7 @@ using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Mode; using v2rayN.Mode;
using System.Linq; using System.Linq;
using v2rayN.Resx;
namespace v2rayN.Handler namespace v2rayN.Handler
{ {
@@ -88,7 +89,7 @@ namespace v2rayN.Handler
if (item.configType != EConfigType.Vmess if (item.configType != EConfigType.Vmess
&& item.configType != EConfigType.VLESS) && item.configType != EConfigType.VLESS)
{ {
UI.Show(UIRes.I18N("NonVmessService")); UI.Show(ResUI.NonVmessService);
return; return;
} }
@@ -115,7 +116,7 @@ namespace v2rayN.Handler
} }
else else
{ {
UI.ShowWarning(string.Format(UIRes.I18N("SaveClientConfigurationIn"), fileName)); UI.ShowWarning(string.Format(ResUI.SaveClientConfigurationIn, fileName));
} }
} }
@@ -128,7 +129,7 @@ namespace v2rayN.Handler
if (item.configType != EConfigType.Vmess if (item.configType != EConfigType.Vmess
&& item.configType != EConfigType.VLESS) && item.configType != EConfigType.VLESS)
{ {
UI.Show(UIRes.I18N("NonVmessService")); UI.Show(ResUI.NonVmessService);
return; return;
} }
@@ -155,7 +156,7 @@ namespace v2rayN.Handler
} }
else else
{ {
UI.ShowWarning(string.Format(UIRes.I18N("SaveServerConfigurationIn"), fileName)); UI.ShowWarning(string.Format(ResUI.SaveServerConfigurationIn, fileName));
} }
} }
@@ -191,11 +192,11 @@ namespace v2rayN.Handler
if (ret == 0) if (ret == 0)
{ {
UI.Show(UIRes.I18N("OperationSuccess")); UI.Show(ResUI.OperationSuccess);
} }
else else
{ {
UI.ShowWarning(UIRes.I18N("OperationFailed")); UI.ShowWarning(ResUI.OperationFailed);
} }
} }
} }
@@ -207,33 +208,54 @@ namespace v2rayN.Handler
private void UpdateTaskRun(Config config, Action<bool, string> update) private void UpdateTaskRun(Config config, Action<bool, string> update)
{ {
var autoUpdateSubTime = DateTime.Now;
var autoUpdateGeoTime = DateTime.Now;
Thread.Sleep(60000);
Utils.SaveLog("UpdateTaskRun");
var updateHandle = new UpdateHandle(); var updateHandle = new UpdateHandle();
while (true) while (true)
{ {
Thread.Sleep(60000); var dtNow = DateTime.Now;
if (config.autoUpdateInterval <= 0)
if (config.autoUpdateSubInterval > 0)
{ {
continue; if ((dtNow - autoUpdateSubTime).Hours % config.autoUpdateSubInterval == 0)
{
updateHandle.UpdateSubscriptionProcess(config, true, (bool success, string msg) =>
{
update(success, msg);
if (success)
Utils.SaveLog("subscription" + msg);
});
autoUpdateSubTime = dtNow;
}
Thread.Sleep(60000);
} }
Utils.SaveLog("UpdateTaskRun");
updateHandle.UpdateGeoFile("geosite", config, (bool success, string msg) => if (config.autoUpdateInterval > 0)
{ {
update(false, msg); if ((dtNow - autoUpdateGeoTime).Hours % config.autoUpdateInterval == 0)
if (success) {
Utils.SaveLog("geosite" + msg); updateHandle.UpdateGeoFile("geosite", config, (bool success, string msg) =>
}); {
update(false, msg);
if (success)
Utils.SaveLog("geosite" + msg);
});
Thread.Sleep(60000); updateHandle.UpdateGeoFile("geoip", config, (bool success, string msg) =>
{
update(false, msg);
if (success)
Utils.SaveLog("geoip" + msg);
});
autoUpdateGeoTime = dtNow;
}
}
updateHandle.UpdateGeoFile("geoip", config, (bool success, string msg) => Thread.Sleep(1000 * 3600);
{
update(false, msg);
if (success)
Utils.SaveLog("geoip" + msg);
});
Thread.Sleep(1000 * 3600 * config.autoUpdateInterval);
} }
} }
@@ -268,12 +290,12 @@ namespace v2rayN.Handler
try try
{ {
HotkeyManager.Current.AddOrReplace(((int)item.eGlobalHotkey).ToString(), keys, handler); HotkeyManager.Current.AddOrReplace(((int)item.eGlobalHotkey).ToString(), keys, handler);
var msg = string.Format(UIRes.I18N("RegisterGlobalHotkeySuccessfully"), $"{item.eGlobalHotkey.ToString()} = {keys}"); var msg = string.Format(ResUI.RegisterGlobalHotkeySuccessfully, $"{item.eGlobalHotkey.ToString()} = {keys}");
update(false, msg); update(false, msg);
} }
catch (Exception ex) catch (Exception ex)
{ {
var msg = string.Format(UIRes.I18N("RegisterGlobalHotkeyFailed"), $"{item.eGlobalHotkey.ToString()} = {keys}", ex.Message); var msg = string.Format(ResUI.RegisterGlobalHotkeyFailed, $"{item.eGlobalHotkey.ToString()} = {keys}", ex.Message);
update(false, msg); update(false, msg);
Utils.SaveLog(msg); Utils.SaveLog(msg);
} }

View File

@@ -9,6 +9,7 @@ using System.Threading.Tasks;
using System.Web; using System.Web;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler namespace v2rayN.Handler
{ {
@@ -318,7 +319,7 @@ namespace v2rayN.Handler
string result = clipboardData.TrimEx();// Utils.GetClipboardData(); string result = clipboardData.TrimEx();// Utils.GetClipboardData();
if (Utils.IsNullOrEmpty(result)) if (Utils.IsNullOrEmpty(result))
{ {
msg = UIRes.I18N("FailedReadConfiguration"); msg = ResUI.FailedReadConfiguration;
return null; return null;
} }
@@ -338,7 +339,7 @@ namespace v2rayN.Handler
} }
else if (result.StartsWith(Global.ssProtocol)) else if (result.StartsWith(Global.ssProtocol))
{ {
msg = UIRes.I18N("ConfigurationFormatIncorrect"); msg = ResUI.ConfigurationFormatIncorrect;
vmessItem = ResolveSSLegacy(result); vmessItem = ResolveSSLegacy(result);
if (vmessItem == null) if (vmessItem == null)
@@ -358,7 +359,7 @@ namespace v2rayN.Handler
} }
else if (result.StartsWith(Global.socksProtocol)) else if (result.StartsWith(Global.socksProtocol))
{ {
msg = UIRes.I18N("ConfigurationFormatIncorrect"); msg = ResUI.ConfigurationFormatIncorrect;
vmessItem = ResolveSocksNew(result); vmessItem = ResolveSocksNew(result);
if (vmessItem == null) if (vmessItem == null)
@@ -378,7 +379,7 @@ namespace v2rayN.Handler
} }
else if (result.StartsWith(Global.trojanProtocol)) else if (result.StartsWith(Global.trojanProtocol))
{ {
msg = UIRes.I18N("ConfigurationFormatIncorrect"); msg = ResUI.ConfigurationFormatIncorrect;
vmessItem = ResolveTrojan(result); vmessItem = ResolveTrojan(result);
} }
@@ -390,13 +391,13 @@ namespace v2rayN.Handler
} }
else else
{ {
msg = UIRes.I18N("NonvmessOrssProtocol"); msg = ResUI.NonvmessOrssProtocol;
return null; return null;
} }
} }
catch catch
{ {
msg = UIRes.I18N("Incorrectconfiguration"); msg = ResUI.Incorrectconfiguration;
return null; return null;
} }
@@ -416,7 +417,7 @@ namespace v2rayN.Handler
VmessQRCode vmessQRCode = Utils.FromJson<VmessQRCode>(result); VmessQRCode vmessQRCode = Utils.FromJson<VmessQRCode>(result);
if (vmessQRCode == null) if (vmessQRCode == null)
{ {
msg = UIRes.I18N("FailedConversionConfiguration"); msg = ResUI.FailedConversionConfiguration;
return null; return null;
} }
@@ -507,7 +508,7 @@ namespace v2rayN.Handler
i.address = u.IdnHost; i.address = u.IdnHost;
i.port = u.Port; i.port = u.Port;
i.remarks = Utils.UrlDecode(u.GetComponents(UriComponents.Fragment, UriFormat.Unescaped)); i.remarks = u.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
var q = HttpUtility.ParseQueryString(u.Query); var q = HttpUtility.ParseQueryString(u.Query);
var m = StdVmessUserInfo.Match(u.UserInfo); var m = StdVmessUserInfo.Match(u.UserInfo);
@@ -589,13 +590,13 @@ namespace v2rayN.Handler
} }
VmessItem server = new VmessItem VmessItem server = new VmessItem
{ {
remarks = Utils.UrlDecode(parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped)), remarks = parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped),
address = parsedUrl.IdnHost, address = parsedUrl.IdnHost,
port = parsedUrl.Port, port = parsedUrl.Port,
}; };
// parse base64 UserInfo // parse base64 UserInfo
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.Unescaped); string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.UriEscaped);
string userInfo = Utils.Base64Decode(rawUserInfo); string userInfo = Utils.Base64Decode(rawUserInfo);
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2); string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2);
if (userInfoParts.Length != 2) if (userInfoParts.Length != 2)
@@ -711,7 +712,7 @@ namespace v2rayN.Handler
} }
VmessItem server = new VmessItem VmessItem server = new VmessItem
{ {
remarks = Utils.UrlDecode(parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped)), remarks = parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped),
address = parsedUrl.IdnHost, address = parsedUrl.IdnHost,
port = parsedUrl.Port, port = parsedUrl.Port,
}; };
@@ -740,7 +741,7 @@ namespace v2rayN.Handler
item.address = url.IdnHost; item.address = url.IdnHost;
item.port = url.Port; item.port = url.Port;
item.remarks = Utils.UrlDecode(url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped)); item.remarks = url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
item.id = url.UserInfo; item.id = url.UserInfo;
var query = HttpUtility.ParseQueryString(url.Query); var query = HttpUtility.ParseQueryString(url.Query);
@@ -760,7 +761,7 @@ namespace v2rayN.Handler
item.address = url.IdnHost; item.address = url.IdnHost;
item.port = url.Port; item.port = url.Port;
item.remarks = Utils.UrlDecode(url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped)); item.remarks = url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
item.id = url.UserInfo; item.id = url.UserInfo;
var query = HttpUtility.ParseQueryString(url.Query); var query = HttpUtility.ParseQueryString(url.Query);

View File

@@ -6,6 +6,7 @@ using System.Net.Sockets;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler namespace v2rayN.Handler
{ {
@@ -16,12 +17,12 @@ namespace v2rayN.Handler
private List<ServerTestItem> _selecteds; private List<ServerTestItem> _selecteds;
Action<string, string> _updateFunc; Action<string, string> _updateFunc;
public SpeedtestHandler(ref Config config) public SpeedtestHandler(Config config)
{ {
_config = config; _config = config;
} }
public SpeedtestHandler(ref Config config, V2rayHandler v2rayHandler, List<VmessItem> selecteds, ESpeedActionType actionType, Action<string, string> update) public SpeedtestHandler(Config config, V2rayHandler v2rayHandler, List<VmessItem> selecteds, ESpeedActionType actionType, Action<string, string> update)
{ {
_config = config; _config = config;
_v2rayHandler = v2rayHandler; _v2rayHandler = v2rayHandler;
@@ -54,7 +55,7 @@ namespace v2rayN.Handler
} }
else if (actionType == ESpeedActionType.Speedtest) else if (actionType == ESpeedActionType.Speedtest)
{ {
Task.Run(() => RunSpeedTest()); Task.Run(() => RunSpeedTestAsync());
} }
} }
@@ -70,7 +71,7 @@ namespace v2rayN.Handler
} }
try try
{ {
updateFun(it); Task.Run(() => updateFun(it));
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -117,10 +118,11 @@ namespace v2rayN.Handler
pid = _v2rayHandler.LoadV2rayConfigString(_config, _selecteds); pid = _v2rayHandler.LoadV2rayConfigString(_config, _selecteds);
if (pid < 0) if (pid < 0)
{ {
_updateFunc(_selecteds[0].indexId, UIRes.I18N("OperationFailed")); _updateFunc(_selecteds[0].indexId, ResUI.OperationFailed);
return; return;
} }
DownloadHandle downloadHandle = new DownloadHandle();
//Thread.Sleep(5000); //Thread.Sleep(5000);
List<Task> tasks = new List<Task>(); List<Task> tasks = new List<Task>();
foreach (var it in _selecteds) foreach (var it in _selecteds)
@@ -139,7 +141,7 @@ namespace v2rayN.Handler
{ {
WebProxy webProxy = new WebProxy(Global.Loopback, it.port); WebProxy webProxy = new WebProxy(Global.Loopback, it.port);
int responseTime = -1; int responseTime = -1;
string status = GetRealPingTime(_config.constItem.speedPingTestUrl, webProxy, out responseTime); string status = downloadHandle.GetRealPingTime(_config.constItem.speedPingTestUrl, webProxy, out responseTime);
string output = Utils.IsNullOrEmpty(status) ? FormatOut(responseTime, "ms") : status; string output = Utils.IsNullOrEmpty(status) ? FormatOut(responseTime, "ms") : status;
_config.GetVmessItem(it.indexId)?.SetTestResult(output); _config.GetVmessItem(it.indexId)?.SetTestResult(output);
@@ -164,38 +166,7 @@ namespace v2rayN.Handler
} }
} }
public int RunAvailabilityCheck() // alias: isLive private async Task RunSpeedTestAsync()
{
try
{
int httpPort = _config.GetLocalPort(Global.InboundHttp);
Task<int> t = Task.Run(() =>
{
try
{
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort);
int responseTime = -1;
string status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out responseTime);
bool noError = Utils.IsNullOrEmpty(status);
return noError ? responseTime : -1;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return -1;
}
});
return t.Result;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return -1;
}
}
private void RunSpeedTest()
{ {
string testIndexId = string.Empty; string testIndexId = string.Empty;
int pid = -1; int pid = -1;
@@ -203,7 +174,7 @@ namespace v2rayN.Handler
pid = _v2rayHandler.LoadV2rayConfigString(_config, _selecteds); pid = _v2rayHandler.LoadV2rayConfigString(_config, _selecteds);
if (pid < 0) if (pid < 0)
{ {
_updateFunc(_selecteds[0].indexId, UIRes.I18N("OperationFailed")); _updateFunc(_selecteds[0].indexId, ResUI.OperationFailed);
return; return;
} }
@@ -219,7 +190,7 @@ namespace v2rayN.Handler
_updateFunc(testIndexId, args.GetException().Message); _updateFunc(testIndexId, args.GetException().Message);
}; };
var timeout = 10; var timeout = 8;
foreach (var it in _selecteds) foreach (var it in _selecteds)
{ {
if (!it.allowTest) if (!it.allowTest)
@@ -234,15 +205,9 @@ namespace v2rayN.Handler
if (_config.FindIndexId(it.indexId) < 0) continue; if (_config.FindIndexId(it.indexId) < 0) continue;
WebProxy webProxy = new WebProxy(Global.Loopback, it.port); WebProxy webProxy = new WebProxy(Global.Loopback, it.port);
var ws = downloadHandle2.DownloadDataAsync(url, webProxy, timeout - 2); await downloadHandle2.DownloadDataAsync(url, webProxy, timeout);
Thread.Sleep(1000 * timeout);
ws.CancelAsync();
ws.Dispose();
Thread.Sleep(1000 * 2);
} }
if (pid > 0) _v2rayHandler.V2rayStopPid(pid); if (pid > 0) _v2rayHandler.V2rayStopPid(pid);
} }
@@ -281,37 +246,6 @@ namespace v2rayN.Handler
return responseTime; return responseTime;
} }
private string GetRealPingTime(string url, WebProxy webProxy, out int responseTime)
{
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);
Stopwatch timer = new Stopwatch();
timer.Start();
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
if (myHttpWebResponse.StatusCode != HttpStatusCode.OK
&& myHttpWebResponse.StatusCode != HttpStatusCode.NoContent)
{
msg = myHttpWebResponse.StatusDescription;
}
timer.Stop();
responseTime = timer.Elapsed.Milliseconds;
myHttpWebResponse.Close();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
msg = ex.Message;
}
return msg;
}
private string FormatOut(object time, string unit) private string FormatOut(object time, string unit)
{ {
if (time.ToString().Equals("-1")) if (time.ToString().Equals("-1"))

View File

@@ -59,8 +59,7 @@ namespace v2rayN.Handler
try try
{ {
Global.httpPort = config.GetLocalPort(Global.InboundHttp); int port = config.GetLocalPort(Global.InboundHttp);
int port = Global.httpPort;
if (port <= 0) if (port <= 0)
{ {
return false; return false;

View File

@@ -1,13 +1,13 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Net;
using System.Net.Http;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler namespace v2rayN.Handler
{ {
@@ -53,7 +53,7 @@ namespace v2rayN.Handler
{ {
if (args.Success) if (args.Success)
{ {
_updateFunc(false, UIRes.I18N("MsgDownloadV2rayCoreSuccessfully")); _updateFunc(false, ResUI.MsgDownloadV2rayCoreSuccessfully);
try try
{ {
@@ -93,7 +93,7 @@ namespace v2rayN.Handler
{ {
if (args.Success) if (args.Success)
{ {
_updateFunc(false, string.Format(UIRes.I18N("MsgParsingSuccessfully"), "v2rayN")); _updateFunc(false, string.Format(ResUI.MsgParsingSuccessfully, "v2rayN"));
url = args.Msg; url = args.Msg;
askToDownload(downloadHandle, url, true); askToDownload(downloadHandle, url, true);
@@ -103,7 +103,7 @@ namespace v2rayN.Handler
_updateFunc(false, args.Msg); _updateFunc(false, args.Msg);
} }
}; };
_updateFunc(false, string.Format(UIRes.I18N("MsgStartUpdating"), "v2rayN")); _updateFunc(false, string.Format(ResUI.MsgStartUpdating, "v2rayN"));
CheckUpdateAsync(ECoreType.v2rayN); CheckUpdateAsync(ECoreType.v2rayN);
} }
@@ -122,8 +122,8 @@ namespace v2rayN.Handler
{ {
if (args.Success) if (args.Success)
{ {
_updateFunc(false, UIRes.I18N("MsgDownloadV2rayCoreSuccessfully")); _updateFunc(false, ResUI.MsgDownloadV2rayCoreSuccessfully);
_updateFunc(false, UIRes.I18N("MsgUnpacking")); _updateFunc(false, ResUI.MsgUnpacking);
try try
{ {
@@ -149,7 +149,7 @@ namespace v2rayN.Handler
{ {
if (args.Success) if (args.Success)
{ {
_updateFunc(false, string.Format(UIRes.I18N("MsgParsingSuccessfully"), "Core")); _updateFunc(false, string.Format(ResUI.MsgParsingSuccessfully, "Core"));
url = args.Msg; url = args.Msg;
askToDownload(downloadHandle, url, true); askToDownload(downloadHandle, url, true);
} }
@@ -158,7 +158,7 @@ namespace v2rayN.Handler
_updateFunc(false, args.Msg); _updateFunc(false, args.Msg);
} }
}; };
_updateFunc(false, string.Format(UIRes.I18N("MsgStartUpdating"), "Core")); _updateFunc(false, string.Format(ResUI.MsgStartUpdating, "Core"));
CheckUpdateAsync(type); CheckUpdateAsync(type);
} }
@@ -168,75 +168,57 @@ namespace v2rayN.Handler
_config = config; _config = config;
_updateFunc = update; _updateFunc = update;
_updateFunc(false, UIRes.I18N("MsgUpdateSubscriptionStart")); _updateFunc(false, ResUI.MsgUpdateSubscriptionStart);
if (config.subItem == null || config.subItem.Count <= 0) if (config.subItem == null || config.subItem.Count <= 0)
{ {
_updateFunc(false, UIRes.I18N("MsgNoValidSubscription")); _updateFunc(false, ResUI.MsgNoValidSubscription);
return; return;
} }
for (int k = 1; k <= config.subItem.Count; k++) Task.Run(async () =>
{ {
string id = config.subItem[k - 1].id.TrimEx(); foreach (var item in config.subItem)
string url = config.subItem[k - 1].url.TrimEx();
string userAgent = config.subItem[k - 1].userAgent.TrimEx();
string groupId = config.subItem[k - 1].groupId.TrimEx();
string hashCode = $"{k}){config.subItem[k - 1].remarks}->";
if (config.subItem[k - 1].enabled == false)
{ {
continue; if (item.enabled == false)
}
if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url))
{
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgNoValidSubscription")}");
continue;
}
DownloadHandle downloadHandle3 = new DownloadHandle();
downloadHandle3.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{ {
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}"); continue;
//string result = Utils.Base64Decode(args.Msg); }
string result = args.Msg; string id = item.id.TrimEx();
if (Utils.IsNullOrEmpty(result)) string url = item.url.TrimEx();
{ string userAgent = item.userAgent.TrimEx();
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}"); string groupId = item.groupId.TrimEx();
return; string hashCode = $"{item.remarks}->";
} if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url))
{
//_updateFunc(false, $"{hashCode}{ResUI.MsgNoValidSubscription}");
continue;
}
//ConfigHandler.RemoveServerViaSubid(ref config, id); _updateFunc(false, $"{hashCode}{ResUI.MsgStartGettingSubscriptions}");
//_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}"); var result = await (new DownloadHandle()).DownloadStringAsync(url, blProxy, userAgent);
// RefreshServers();
int ret = ConfigHandler.AddBatchServers(ref config, result, id, groupId); _updateFunc(false, $"{hashCode}{ResUI.MsgGetSubscriptionSuccessfully}");
if (ret > 0) if (Utils.IsNullOrEmpty(result))
{ {
// RefreshServers(); _updateFunc(false, $"{hashCode}{ResUI.MsgSubscriptionDecodingFailed}");
}
else
{
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgFailedImportSubscription")}");
}
_updateFunc(true, $"{hashCode}{UIRes.I18N("MsgUpdateSubscriptionEnd")}");
} }
else else
{ {
_updateFunc(false, args.Msg); int ret = ConfigHandler.AddBatchServers(ref config, result, id, groupId);
if (ret > 0)
{
_updateFunc(false, $"{hashCode}{ResUI.MsgUpdateSubscriptionEnd}");
}
else
{
_updateFunc(false, $"{hashCode}{ResUI.MsgFailedImportSubscription}");
}
} }
}; _updateFunc(false, $"-------------------------------------------------------");
downloadHandle3.Error += (sender2, args) => }
{ _updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
_updateFunc(false, args.GetException().Message); });
};
WebProxy webProxy = blProxy ? new WebProxy(Global.Loopback, _config.GetLocalPort(Global.InboundHttp)) : null;
downloadHandle3.WebDownloadString(url, webProxy, userAgent);
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
}
} }
@@ -255,7 +237,7 @@ namespace v2rayN.Handler
{ {
if (args.Success) if (args.Success)
{ {
_updateFunc(false, string.Format(UIRes.I18N("MsgDownloadGeoFileSuccessfully"), geoName)); _updateFunc(false, string.Format(ResUI.MsgDownloadGeoFileSuccessfully, geoName));
try try
{ {
@@ -268,7 +250,7 @@ namespace v2rayN.Handler
File.Delete(targetPath); File.Delete(targetPath);
} }
File.Move(fileName, targetPath); File.Move(fileName, targetPath);
_updateFunc(true, ""); //_updateFunc(true, "");
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -286,8 +268,18 @@ namespace v2rayN.Handler
_updateFunc(false, args.GetException().Message); _updateFunc(false, args.GetException().Message);
}; };
} }
askToDownload(downloadHandle, url, false); askToDownload(downloadHandle, url, false);
}
public void RunAvailabilityCheck(Action<bool, string> update)
{
Task.Run(() =>
{
var time = (new DownloadHandle()).RunAvailabilityCheck(null);
update(false, string.Format(ResUI.TestMeOutput, time));
});
} }
#region private #region private
@@ -296,19 +288,6 @@ namespace v2rayN.Handler
{ {
try try
{ {
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().enableSecurityProtocolTls13);
WebRequestHandler webRequestHandler = new WebRequestHandler
{
AllowAutoRedirect = false
};
if (httpProxyTest() > 0)
{
int httpPort = _config.GetLocalPort(Global.InboundHttp);
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort);
webRequestHandler.Proxy = webProxy;
}
HttpClient httpClient = new HttpClient(webRequestHandler);
string url; string url;
if (type == ECoreType.v2fly) if (type == ECoreType.v2fly)
{ {
@@ -326,10 +305,11 @@ namespace v2rayN.Handler
{ {
throw new ArgumentException("Type"); throw new ArgumentException("Type");
} }
HttpResponseMessage response = await httpClient.GetAsync(url);
if (response.StatusCode.ToString() == "Redirect") var result = await (new DownloadHandle()).UrlRedirectAsync(url, true);
if (!Utils.IsNullOrEmpty(result))
{ {
responseHandler(type, response.Headers.Location.ToString()); responseHandler(type, result);
} }
else else
{ {
@@ -351,22 +331,23 @@ namespace v2rayN.Handler
{ {
try try
{ {
var core = string.Empty;
var match = string.Empty; var coreInfo = LazyConfig.Instance.GetCoreInfo(type);
if (type == ECoreType.v2fly) string filePath = string.Empty;
foreach (string name in coreInfo.coreExes)
{ {
core = "v2ray.exe"; string vName = string.Format("{0}.exe", name);
match = "V2Ray"; vName = Utils.GetPath(vName);
if (File.Exists(vName))
{
filePath = vName;
break;
}
} }
else if (type == ECoreType.Xray)
{
core = "xray.exe";
match = "Xray";
}
string filePath = Utils.GetPath(core);
if (!File.Exists(filePath)) if (!File.Exists(filePath))
{ {
string msg = string.Format(UIRes.I18N("NotFoundCore"), @""); string msg = string.Format(ResUI.NotFoundCore, @"");
//ShowMsg(true, msg); //ShowMsg(true, msg);
return ""; return "";
} }
@@ -382,7 +363,7 @@ namespace v2rayN.Handler
p.Start(); p.Start();
p.WaitForExit(5000); p.WaitForExit(5000);
string echo = p.StandardOutput.ReadToEnd(); string echo = p.StandardOutput.ReadToEnd();
string version = Regex.Match(echo, $"{match} ([0-9.]+) \\(").Groups[1].Value; string version = Regex.Match(echo, $"{coreInfo.match} ([0-9.]+) \\(").Groups[1].Value;
return version; return version;
} }
catch (Exception ex) catch (Exception ex)
@@ -404,21 +385,21 @@ namespace v2rayN.Handler
if (type == ECoreType.v2fly) if (type == ECoreType.v2fly)
{ {
curVersion = "v" + getCoreVersion(type); curVersion = "v" + getCoreVersion(type);
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion); message = string.Format(ResUI.IsLatestCore, curVersion);
string osBit = Environment.Is64BitProcess ? "64" : "32"; string osBit = Environment.Is64BitProcess ? "64" : "32";
url = string.Format(v2flyCoreUrl, version, osBit); url = string.Format(v2flyCoreUrl, version, osBit);
} }
else if (type == ECoreType.Xray) else if (type == ECoreType.Xray)
{ {
curVersion = "v" + getCoreVersion(type); curVersion = "v" + getCoreVersion(type);
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion); message = string.Format(ResUI.IsLatestCore, curVersion);
string osBit = Environment.Is64BitProcess ? "64" : "32"; string osBit = Environment.Is64BitProcess ? "64" : "32";
url = string.Format(xrayCoreUrl, version, osBit); url = string.Format(xrayCoreUrl, version, osBit);
} }
else if (type == ECoreType.v2rayN) else if (type == ECoreType.v2rayN)
{ {
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString(); curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
message = string.Format(UIRes.I18N("IsLatestN"), curVersion); message = string.Format(ResUI.IsLatestN, curVersion);
url = string.Format(nUrl, version); url = string.Format(nUrl, version);
} }
else else
@@ -446,7 +427,7 @@ namespace v2rayN.Handler
bool blDownload = false; bool blDownload = false;
if (blAsk) if (blAsk)
{ {
if (UI.ShowYesNo(string.Format(UIRes.I18N("DownloadYesNo"), url)) == DialogResult.Yes) if (UI.ShowYesNo(string.Format(ResUI.DownloadYesNo, url)) == DialogResult.Yes)
{ {
blDownload = true; blDownload = true;
} }
@@ -457,24 +438,9 @@ namespace v2rayN.Handler
} }
if (blDownload) if (blDownload)
{ {
if (httpProxyTest() > 0) downloadHandle.DownloadFileAsync(url, true, 600);
{
int httpPort = _config.GetLocalPort(Global.InboundHttp);
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort);
downloadHandle.DownloadFileAsync(url, webProxy, 600);
}
else
{
downloadHandle.DownloadFileAsync(url, null, 600);
}
} }
} }
private int httpProxyTest()
{
SpeedtestHandler statistics = new SpeedtestHandler(ref _config);
return statistics.RunAvailabilityCheck();
}
#endregion #endregion
} }
} }

View File

@@ -6,6 +6,7 @@ using System.Net;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler namespace v2rayN.Handler
{ {
@@ -32,11 +33,11 @@ namespace v2rayN.Handler
{ {
if (node == null) if (node == null)
{ {
msg = UIRes.I18N("CheckServerSettings"); msg = ResUI.CheckServerSettings;
return -1; return -1;
} }
msg = UIRes.I18N("InitialConfiguration"); msg = ResUI.InitialConfiguration;
if (node.configType == EConfigType.Custom) if (node.configType == EConfigType.Custom)
{ {
return GenerateClientCustomConfig(node, fileName, out msg); return GenerateClientCustomConfig(node, fileName, out msg);
@@ -46,7 +47,7 @@ namespace v2rayN.Handler
string result = Utils.GetEmbedText(SampleClient); string result = Utils.GetEmbedText(SampleClient);
if (Utils.IsNullOrEmpty(result)) if (Utils.IsNullOrEmpty(result))
{ {
msg = UIRes.I18N("FailedGetDefaultConfiguration"); msg = ResUI.FailedGetDefaultConfiguration;
return -1; return -1;
} }
@@ -54,7 +55,7 @@ namespace v2rayN.Handler
V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result); V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result);
if (v2rayConfig == null) if (v2rayConfig == null)
{ {
msg = UIRes.I18N("FailedGenDefaultConfiguration"); msg = ResUI.FailedGenDefaultConfiguration;
return -1; return -1;
} }
@@ -80,11 +81,11 @@ namespace v2rayN.Handler
Utils.ToJsonFile(v2rayConfig, fileName, false); Utils.ToJsonFile(v2rayConfig, fileName, false);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), $"[{config.GetGroupRemarks(node.groupId)}] {node.GetSummary()}"); msg = string.Format(ResUI.SuccessfulConfiguration, $"[{config.GetGroupRemarks(node.groupId)}] {node.GetSummary()}");
} }
catch catch
{ {
msg = UIRes.I18N("FailedGenDefaultConfiguration"); msg = ResUI.FailedGenDefaultConfiguration;
return -1; return -1;
} }
return 0; return 0;
@@ -145,30 +146,35 @@ namespace v2rayN.Handler
{ {
try try
{ {
Inbounds inbound = v2rayConfig.inbounds[0]; v2rayConfig.inbounds = new List<Inbounds>();
inbound.tag = Global.InboundSocks;
inbound.port = config.inbound[0].localPort; Inbounds inbound = GetInbound(config.inbound[0], Global.InboundSocks, 0, true);
inbound.protocol = config.inbound[0].protocol; v2rayConfig.inbounds.Add(inbound);
if (config.allowLANConn)
{
inbound.listen = "0.0.0.0";
}
else
{
inbound.listen = Global.Loopback;
}
//udp
inbound.settings.udp = config.inbound[0].udpEnabled;
inbound.sniffing.enabled = config.inbound[0].sniffingEnabled;
//http //http
Inbounds inbound2 = v2rayConfig.inbounds[1]; Inbounds inbound2 = GetInbound(config.inbound[0], Global.InboundHttp, 1, false);
inbound2.tag = Global.InboundHttp; v2rayConfig.inbounds.Add(inbound2);
inbound2.port = config.GetLocalPort(Global.InboundHttp);
inbound2.protocol = Global.InboundHttp; if (config.inbound[0].allowLANConn)
inbound2.listen = inbound.listen; {
inbound2.settings.allowTransparent = false; Inbounds inbound3 = GetInbound(config.inbound[0], Global.InboundSocks2, 2, true);
inbound2.sniffing.enabled = inbound.sniffing.enabled; v2rayConfig.inbounds.Add(inbound3);
Inbounds inbound4 = GetInbound(config.inbound[0], Global.InboundHttp2, 3, false);
v2rayConfig.inbounds.Add(inbound4);
//auth
if (!Utils.IsNullOrEmpty(config.inbound[0].user) && !Utils.IsNullOrEmpty(config.inbound[0].pass))
{
inbound3.listen = "0.0.0.0";
inbound3.settings.auth = "password";
inbound3.settings.accounts = new List<AccountsItem> { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } };
inbound4.listen = "0.0.0.0";
inbound4.settings.auth = "password";
inbound4.settings.accounts = new List<AccountsItem> { new AccountsItem() { user = config.inbound[0].user, pass = config.inbound[0].pass } };
}
}
} }
catch catch
{ {
@@ -176,6 +182,28 @@ namespace v2rayN.Handler
return 0; return 0;
} }
private static Inbounds GetInbound(InItem inItem, string tag, int offset, bool bSocks)
{
string result = Utils.GetEmbedText(Global.v2raySampleInbound);
if (Utils.IsNullOrEmpty(result))
{
return null;
}
var inbound = Utils.FromJson<Inbounds>(result);
if (inbound == null)
{
return null;
}
inbound.tag = tag;
inbound.port = inItem.localPort + offset;
inbound.protocol = bSocks ? Global.InboundSocks : Global.InboundHttp;
inbound.settings.udp = inItem.udpEnabled;
inbound.sniffing.enabled = inItem.sniffingEnabled;
return inbound;
}
/// <summary> /// <summary>
/// 路由 /// 路由
/// </summary> /// </summary>
@@ -901,7 +929,7 @@ namespace v2rayN.Handler
//检查GUI设置 //检查GUI设置
if (node == null) if (node == null)
{ {
msg = UIRes.I18N("CheckServerSettings"); msg = ResUI.CheckServerSettings;
return -1; return -1;
} }
@@ -917,7 +945,7 @@ namespace v2rayN.Handler
} }
if (!File.Exists(addressFileName)) if (!File.Exists(addressFileName))
{ {
msg = UIRes.I18N("FailedGenDefaultConfiguration"); msg = ResUI.FailedGenDefaultConfiguration;
return -1; return -1;
} }
File.Copy(addressFileName, fileName); File.Copy(addressFileName, fileName);
@@ -925,7 +953,7 @@ namespace v2rayN.Handler
//check again //check again
if (!File.Exists(fileName)) if (!File.Exists(fileName))
{ {
msg = UIRes.I18N("FailedGenDefaultConfiguration"); msg = ResUI.FailedGenDefaultConfiguration;
return -1; return -1;
} }
@@ -938,18 +966,19 @@ namespace v2rayN.Handler
case ECoreType.Xray: case ECoreType.Xray:
break; break;
case ECoreType.clash: case ECoreType.clash:
case ECoreType.clash_meta:
fileContent.Add($"port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp)}"); fileContent.Add($"port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp)}");
fileContent.Add($"socks-port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundSocks)}"); fileContent.Add($"socks-port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundSocks)}");
break; break;
} }
File.WriteAllLines(fileName, fileContent); File.WriteAllLines(fileName, fileContent);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), $"[{LazyConfig.Instance.GetConfig().GetGroupRemarks(node.groupId)}] {node.GetSummary()}"); msg = string.Format(ResUI.SuccessfulConfiguration, $"[{LazyConfig.Instance.GetConfig().GetGroupRemarks(node.groupId)}] {node.GetSummary()}");
} }
catch (Exception ex) catch (Exception ex)
{ {
Utils.SaveLog("GenerateClientCustomConfig", ex); Utils.SaveLog("GenerateClientCustomConfig", ex);
msg = UIRes.I18N("FailedGenDefaultConfiguration"); msg = ResUI.FailedGenDefaultConfiguration;
return -1; return -1;
} }
return 0; return 0;
@@ -973,17 +1002,17 @@ namespace v2rayN.Handler
//检查GUI设置 //检查GUI设置
if (node == null) if (node == null)
{ {
msg = UIRes.I18N("CheckServerSettings"); msg = ResUI.CheckServerSettings;
return -1; return -1;
} }
msg = UIRes.I18N("InitialConfiguration"); msg = ResUI.InitialConfiguration;
//取得默认配置 //取得默认配置
string result = Utils.GetEmbedText(SampleServer); string result = Utils.GetEmbedText(SampleServer);
if (Utils.IsNullOrEmpty(result)) if (Utils.IsNullOrEmpty(result))
{ {
msg = UIRes.I18N("FailedGetDefaultConfiguration"); msg = ResUI.FailedGetDefaultConfiguration;
return -1; return -1;
} }
@@ -991,7 +1020,7 @@ namespace v2rayN.Handler
V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result); V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result);
if (v2rayConfig == null) if (v2rayConfig == null)
{ {
msg = UIRes.I18N("FailedGenDefaultConfiguration"); msg = ResUI.FailedGenDefaultConfiguration;
return -1; return -1;
} }
@@ -1008,11 +1037,11 @@ namespace v2rayN.Handler
Utils.ToJsonFile(v2rayConfig, fileName, false); Utils.ToJsonFile(v2rayConfig, fileName, false);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), node.GetSummary()); msg = string.Format(ResUI.SuccessfulConfiguration, node.GetSummary());
} }
catch catch
{ {
msg = UIRes.I18N("FailedGenDefaultConfiguration"); msg = ResUI.FailedGenDefaultConfiguration;
return -1; return -1;
} }
return 0; return 0;
@@ -1110,7 +1139,7 @@ namespace v2rayN.Handler
string result = Utils.LoadResource(fileName); string result = Utils.LoadResource(fileName);
if (Utils.IsNullOrEmpty(result)) if (Utils.IsNullOrEmpty(result))
{ {
msg = UIRes.I18N("FailedReadConfiguration"); msg = ResUI.FailedReadConfiguration;
return null; return null;
} }
@@ -1118,14 +1147,14 @@ namespace v2rayN.Handler
V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result); V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result);
if (v2rayConfig == null) if (v2rayConfig == null)
{ {
msg = UIRes.I18N("FailedConversionConfiguration"); msg = ResUI.FailedConversionConfiguration;
return null; return null;
} }
if (v2rayConfig.outbounds == null if (v2rayConfig.outbounds == null
|| v2rayConfig.outbounds.Count <= 0) || v2rayConfig.outbounds.Count <= 0)
{ {
msg = UIRes.I18N("IncorrectClientConfiguration"); msg = ResUI.IncorrectClientConfiguration;
return null; return null;
} }
@@ -1139,7 +1168,7 @@ namespace v2rayN.Handler
|| outbound.settings.vnext[0].users == null || outbound.settings.vnext[0].users == null
|| outbound.settings.vnext[0].users.Count <= 0) || outbound.settings.vnext[0].users.Count <= 0)
{ {
msg = UIRes.I18N("IncorrectClientConfiguration"); msg = ResUI.IncorrectClientConfiguration;
return null; return null;
} }
@@ -1232,7 +1261,7 @@ namespace v2rayN.Handler
} }
catch catch
{ {
msg = UIRes.I18N("IncorrectClientConfiguration"); msg = ResUI.IncorrectClientConfiguration;
return null; return null;
} }
@@ -1256,7 +1285,7 @@ namespace v2rayN.Handler
string result = Utils.LoadResource(fileName); string result = Utils.LoadResource(fileName);
if (Utils.IsNullOrEmpty(result)) if (Utils.IsNullOrEmpty(result))
{ {
msg = UIRes.I18N("FailedReadConfiguration"); msg = ResUI.FailedReadConfiguration;
return null; return null;
} }
@@ -1264,14 +1293,14 @@ namespace v2rayN.Handler
V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result); V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result);
if (v2rayConfig == null) if (v2rayConfig == null)
{ {
msg = UIRes.I18N("FailedConversionConfiguration"); msg = ResUI.FailedConversionConfiguration;
return null; return null;
} }
if (v2rayConfig.inbounds == null if (v2rayConfig.inbounds == null
|| v2rayConfig.inbounds.Count <= 0) || v2rayConfig.inbounds.Count <= 0)
{ {
msg = UIRes.I18N("IncorrectServerConfiguration"); msg = ResUI.IncorrectServerConfiguration;
return null; return null;
} }
@@ -1283,7 +1312,7 @@ namespace v2rayN.Handler
|| inbound.settings.clients == null || inbound.settings.clients == null
|| inbound.settings.clients.Count <= 0) || inbound.settings.clients.Count <= 0)
{ {
msg = UIRes.I18N("IncorrectServerConfiguration"); msg = ResUI.IncorrectServerConfiguration;
return null; return null;
} }
@@ -1377,7 +1406,7 @@ namespace v2rayN.Handler
} }
catch catch
{ {
msg = UIRes.I18N("IncorrectClientConfiguration"); msg = ResUI.IncorrectClientConfiguration;
return null; return null;
} }
return vmessItem; return vmessItem;
@@ -1418,25 +1447,25 @@ namespace v2rayN.Handler
{ {
if (config == null) if (config == null)
{ {
msg = UIRes.I18N("CheckServerSettings"); msg = ResUI.CheckServerSettings;
return ""; return "";
} }
msg = UIRes.I18N("InitialConfiguration"); msg = ResUI.InitialConfiguration;
Config configCopy = Utils.DeepCopy(config); Config configCopy = Utils.DeepCopy(config);
string result = Utils.GetEmbedText(SampleClient); string result = Utils.GetEmbedText(SampleClient);
if (Utils.IsNullOrEmpty(result)) if (Utils.IsNullOrEmpty(result))
{ {
msg = UIRes.I18N("FailedGetDefaultConfiguration"); msg = ResUI.FailedGetDefaultConfiguration;
return ""; return "";
} }
V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result); V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result);
if (v2rayConfig == null) if (v2rayConfig == null)
{ {
msg = UIRes.I18N("FailedGenDefaultConfiguration"); msg = ResUI.FailedGenDefaultConfiguration;
return ""; return "";
} }
List<IPEndPoint> lstIpEndPoints = null; List<IPEndPoint> lstIpEndPoints = null;
@@ -1517,12 +1546,12 @@ namespace v2rayN.Handler
v2rayConfig.routing.rules.Add(rule); v2rayConfig.routing.rules.Add(rule);
} }
//msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), node.getSummary()); //msg = string.Format(ResUI.SuccessfulConfiguration"), node.getSummary());
return Utils.ToJson(v2rayConfig); return Utils.ToJson(v2rayConfig);
} }
catch catch
{ {
msg = UIRes.I18N("FailedGenDefaultConfiguration"); msg = ResUI.FailedGenDefaultConfiguration;
return ""; return "";
} }
} }

View File

@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.Text; using System.Text;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler namespace v2rayN.Handler
{ {
@@ -40,13 +41,13 @@ namespace v2rayN.Handler
var item = ConfigHandler.GetDefaultServer(ref config); var item = ConfigHandler.GetDefaultServer(ref config);
if (item == null) if (item == null)
{ {
ShowMsg(false, UIRes.I18N("CheckServerSettings")); ShowMsg(false, ResUI.CheckServerSettings);
return; return;
} }
if (SetCore(config, item) != 0) if (SetCore(config, item) != 0)
{ {
ShowMsg(false, UIRes.I18N("CheckServerSettings")); ShowMsg(false, ResUI.CheckServerSettings);
return; return;
} }
string fileName = Utils.GetPath(v2rayConfigRes); string fileName = Utils.GetPath(v2rayConfigRes);
@@ -108,6 +109,10 @@ namespace v2rayN.Handler
} }
else else
{ {
if (coreInfo == null || coreInfo.coreExes == null)
{
return;
}
foreach (string vName in coreInfo.coreExes) foreach (string vName in coreInfo.coreExes)
{ {
Process[] existing = Process.GetProcessesByName(vName); Process[] existing = Process.GetProcessesByName(vName);
@@ -180,7 +185,7 @@ namespace v2rayN.Handler
} }
if (Utils.IsNullOrEmpty(fileName)) if (Utils.IsNullOrEmpty(fileName))
{ {
string msg = string.Format(UIRes.I18N("NotFoundCore"), coreInfo.coreUrl); string msg = string.Format(ResUI.NotFoundCore, coreInfo.coreUrl);
ShowMsg(false, msg); ShowMsg(false, msg);
} }
return fileName; return fileName;
@@ -191,7 +196,7 @@ namespace v2rayN.Handler
/// </summary> /// </summary>
private void V2rayStart() private void V2rayStart()
{ {
ShowMsg(false, string.Format(UIRes.I18N("StartService"), DateTime.Now.ToString())); ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString()));
try try
{ {
@@ -245,7 +250,7 @@ namespace v2rayN.Handler
/// </summary> /// </summary>
private int V2rayStartNew(string configStr) private int V2rayStartNew(string configStr)
{ {
ShowMsg(false, string.Format(UIRes.I18N("StartService"), DateTime.Now.ToString())); ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString()));
try try
{ {

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using System.Linq; using System.Linq;
using System.Drawing;
namespace v2rayN.Mode namespace v2rayN.Mode
{ {
@@ -52,14 +52,6 @@ namespace v2rayN.Mode
get; set; get; set;
} }
/// <summary>
/// 允许来自局域网的连接
/// </summary>
public bool allowLANConn
{
get; set;
}
/// <summary> /// <summary>
/// 启用实时网速和流量统计 /// 启用实时网速和流量统计
/// </summary> /// </summary>
@@ -133,10 +125,9 @@ namespace v2rayN.Mode
get; set; get; set;
} }
public int autoUpdateInterval public int autoUpdateInterval { get; set; } = 0;
{
get; set; public int autoUpdateSubInterval { get; set; } = 0;
} = 0;
public bool enableSecurityProtocolTls13 public bool enableSecurityProtocolTls13
{ {
@@ -216,24 +207,27 @@ namespace v2rayN.Mode
public int GetLocalPort(string protocol) public int GetLocalPort(string protocol)
{ {
if (protocol == Global.InboundHttp) int localPort = inbound.FirstOrDefault(t => t.protocol == Global.InboundSocks).localPort;
{
return GetLocalPort(Global.InboundSocks) + 1;
}
if (protocol == Global.InboundSocks)
{
return localPort;
}
else if (protocol == Global.InboundHttp)
{
return localPort + 1;
}
else if (protocol == Global.InboundSocks2)
{
return localPort + 2;
}
else if (protocol == Global.InboundHttp2)
{
return localPort + 3;
}
else if (protocol == "speedtest") else if (protocol == "speedtest")
{ {
return GetLocalPort(Global.InboundSocks) + 103; return localPort + 103;
}
int localPort = 0;
foreach (InItem inItem in inbound)
{
if (inItem.protocol.Equals(protocol))
{
localPort = inItem.localPort;
break;
}
} }
return localPort; return localPort;
} }
@@ -346,19 +340,31 @@ namespace v2rayN.Mode
{ {
return subRemarks; return subRemarks;
} }
foreach (SubItem sub in config.subItem)
{
if (sub.id.EndsWith(subid))
{
return sub.remarks;
}
}
if (subid.Length <= 4) if (subid.Length <= 4)
{ {
return subid; return subid;
} }
var sub = config.subItem.FirstOrDefault(t => t.id == subid);
if (sub != null)
{
return sub.remarks;
}
return subid.Substring(0, 4); return subid.Substring(0, 4);
} }
public string GetGroupRemarks(Config config)
{
string subRemarks = string.Empty;
if (Utils.IsNullOrEmpty(groupId))
{
return subRemarks;
}
var group = config.groupItem.FirstOrDefault(t => t.id == groupId);
if (group != null)
{
return group.remarks;
}
return groupId.Substring(0, 4);
}
public List<string> GetAlpn() public List<string> GetAlpn()
{ {
@@ -581,6 +587,13 @@ namespace v2rayN.Mode
/// 开启流量探测 /// 开启流量探测
/// </summary> /// </summary>
public bool sniffingEnabled { get; set; } = true; public bool sniffingEnabled { get; set; } = true;
public bool allowLANConn { get; set; }
public string user { get; set; }
public string pass { get; set; }
} }
[Serializable] [Serializable]
@@ -692,7 +705,9 @@ namespace v2rayN.Mode
get; set; get; set;
} }
public System.Drawing.Size mainSize public Point mainLocation { get; set; }
public Size mainSize
{ {
get; set; get; set;
} }
@@ -759,6 +774,10 @@ namespace v2rayN.Mode
{ {
get; set; get; set;
} }
public int sort
{
get; set;
}
} }

View File

@@ -13,5 +13,7 @@ namespace v2rayN.Mode
public string arguments { get; set; } public string arguments { get; set; }
public string coreUrl { get; set; } public string coreUrl { get; set; }
public string match { get; set; }
} }
} }

View File

@@ -6,7 +6,9 @@ namespace v2rayN.Mode
v2fly = 1, v2fly = 1,
Xray = 2, Xray = 2,
clash = 11, clash = 11,
clash_meta = 12,
hysteria = 21, hysteria = 21,
naiveproxy = 22,
v2rayN = 99 v2rayN = 99
} }
} }

View File

@@ -141,6 +141,7 @@ namespace v2rayN.Mode
public bool allowTransparent { get; set; } public bool allowTransparent { get; set; }
public List<AccountsItem> accounts { get; set; }
} }
public class UsersItem public class UsersItem
@@ -540,4 +541,15 @@ namespace v2rayN.Mode
public bool multiMode { get; set; } public bool multiMode { get; set; }
} }
public class AccountsItem
{
/// <summary>
///
/// </summary>
public string user { get; set; }
/// <summary>
///
/// </summary>
public string pass { get; set; }
}
} }

View File

@@ -35,6 +35,7 @@ namespace v2rayN
{ {
Logging.Setup(); Logging.Setup();
Utils.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}"); Utils.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}");
Logging.ClearLogs();
//设置语言环境 //设置语言环境
string lang = Utils.RegReadValue(Global.MyRegPath, Global.MyRegKeyLanguage, "zh-Hans"); string lang = Utils.RegReadValue(Global.MyRegPath, Global.MyRegKeyLanguage, "zh-Hans");
@@ -42,7 +43,7 @@ namespace v2rayN
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm()); Application.Run(new MainForm());
} }
else else
{ {

View File

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

View File

@@ -321,6 +321,24 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 LAN 的本地化字符串。
/// </summary>
internal static string LabLAN {
get {
return ResourceManager.GetString("LabLAN", resourceCulture);
}
}
/// <summary>
/// 查找类似 Local 的本地化字符串。
/// </summary>
internal static string LabLocal {
get {
return ResourceManager.GetString("LabLocal", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Address 的本地化字符串。 /// 查找类似 Address 的本地化字符串。
/// </summary> /// </summary>
@@ -619,7 +637,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Failed to get subscription content 的本地化字符串。 /// 查找类似 Invalid subscription content 的本地化字符串。
/// </summary> /// </summary>
internal static string MsgSubscriptionDecodingFailed { internal static string MsgSubscriptionDecodingFailed {
get { get {
@@ -879,6 +897,15 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 Speed Test... 的本地化字符串。
/// </summary>
internal static string Speedtesting {
get {
return ResourceManager.GetString("Speedtesting", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 PAC failed to start. Run it with Admin right. 的本地化字符串。 /// 查找类似 PAC failed to start. Run it with Admin right. 的本地化字符串。
/// </summary> /// </summary>
@@ -935,7 +962,16 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 The ping of current service: {0} 的本地化字符串。 /// 查找类似 System proxy 的本地化字符串。
/// </summary>
internal static string SystemProxy {
get {
return ResourceManager.GetString("SystemProxy", resourceCulture);
}
}
/// <summary>
/// 查找类似 The ping of current service: {0} ms 的本地化字符串。
/// </summary> /// </summary>
internal static string TestMeOutput { internal static string TestMeOutput {
get { get {
@@ -943,6 +979,15 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 Too many servers, please open the main interface 的本地化字符串。
/// </summary>
internal static string TooManyServersTip {
get {
return ResourceManager.GetString("TooManyServersTip", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 *tcp camouflage type 的本地化字符串。 /// 查找类似 *tcp camouflage type 的本地化字符串。
/// </summary> /// </summary>

View File

@@ -268,7 +268,7 @@
<value>Start updating PAC...</value> <value>Start updating PAC...</value>
</data> </data>
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve"> <data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
<value>Failed to get subscription content</value> <value>Invalid subscription content</value>
</data> </data>
<data name="MsgUnpacking" xml:space="preserve"> <data name="MsgUnpacking" xml:space="preserve">
<value>is unpacking...</value> <value>is unpacking...</value>
@@ -356,7 +356,7 @@
<value>Scan import URL successfully</value> <value>Scan import URL successfully</value>
</data> </data>
<data name="TestMeOutput" xml:space="preserve"> <data name="TestMeOutput" xml:space="preserve">
<value>The ping of current service: {0}</value> <value>The ping of current service: {0} ms</value>
</data> </data>
<data name="OperationSuccess" xml:space="preserve"> <data name="OperationSuccess" xml:space="preserve">
<value>Operation success</value> <value>Operation success</value>
@@ -454,4 +454,19 @@
<data name="FillServerAddressCustom" xml:space="preserve"> <data name="FillServerAddressCustom" xml:space="preserve">
<value>Please browse to import server configuration</value> <value>Please browse to import server configuration</value>
</data> </data>
<data name="SystemProxy" xml:space="preserve">
<value>System proxy</value>
</data>
<data name="Speedtesting" xml:space="preserve">
<value>Speed Test...</value>
</data>
<data name="TooManyServersTip" xml:space="preserve">
<value>Too many servers, please open the main interface</value>
</data>
<data name="LabLAN" xml:space="preserve">
<value>LAN</value>
</data>
<data name="LabLocal" xml:space="preserve">
<value>Local</value>
</data>
</root> </root>

View File

@@ -268,7 +268,7 @@
<value>开始更新 PAC...</value> <value>开始更新 PAC...</value>
</data> </data>
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve"> <data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
<value>订阅内容获取失败</value> <value>无效的订阅内容</value>
</data> </data>
<data name="MsgUnpacking" xml:space="preserve"> <data name="MsgUnpacking" xml:space="preserve">
<value>正在解压......</value> <value>正在解压......</value>
@@ -356,7 +356,7 @@
<value>扫描导入URL成功</value> <value>扫描导入URL成功</value>
</data> </data>
<data name="TestMeOutput" xml:space="preserve"> <data name="TestMeOutput" xml:space="preserve">
<value>当前服务的真连接延迟: {0}</value> <value>当前服务的真连接延迟: {0} ms</value>
</data> </data>
<data name="OperationSuccess" xml:space="preserve"> <data name="OperationSuccess" xml:space="preserve">
<value>操作成功</value> <value>操作成功</value>
@@ -454,4 +454,19 @@
<data name="FillServerAddressCustom" xml:space="preserve"> <data name="FillServerAddressCustom" xml:space="preserve">
<value>请浏览导入服务器配置</value> <value>请浏览导入服务器配置</value>
</data> </data>
<data name="SystemProxy" xml:space="preserve">
<value>系统代理</value>
</data>
<data name="Speedtesting" xml:space="preserve">
<value>测速中...</value>
</data>
<data name="TooManyServersTip" xml:space="preserve">
<value>服务器太多,请打开主界面操作</value>
</data>
<data name="LabLAN" xml:space="preserve">
<value>局域网</value>
</data>
<data name="LabLocal" xml:space="preserve">
<value>本地</value>
</data>
</root> </root>

View File

@@ -24,7 +24,23 @@
{ {
"tag": "tag2", "tag": "tag2",
"port": 10809, "port": 10809,
"protocol": "socks", "protocol": "http",
"listen": "127.0.0.1",
"settings": {
"allowTransparent": false
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
},
{
"tag": "tag3",
"port": 10809,
"protocol": "http",
"listen": "127.0.0.1", "listen": "127.0.0.1",
"settings": { "settings": {
"allowTransparent": false "allowTransparent": false

View File

@@ -0,0 +1,18 @@
{
"tag": "tag1",
"port": 10808,
"protocol": "socks",
"listen": "127.0.0.1",
"settings": {
"auth": "noauth",
"udp": true,
"allowTransparent": false
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}

View File

@@ -3,6 +3,9 @@ using log4net.Appender;
using log4net.Core; using log4net.Core;
using log4net.Layout; using log4net.Layout;
using log4net.Repository.Hierarchy; using log4net.Repository.Hierarchy;
using System;
using System.IO;
using System.Threading.Tasks;
namespace v2rayN.Tool namespace v2rayN.Tool
{ {
@@ -15,7 +18,7 @@ namespace v2rayN.Tool
PatternLayout patternLayout = new PatternLayout(); PatternLayout patternLayout = new PatternLayout();
patternLayout.ConversionPattern = "%date [%thread] %-5level %logger - %message%newline"; patternLayout.ConversionPattern = "%date [%thread] %-5level %logger - %message%newline";
patternLayout.ActivateOptions(); patternLayout.ActivateOptions();
RollingFileAppender roller = new RollingFileAppender(); RollingFileAppender roller = new RollingFileAppender();
roller.AppendToFile = true; roller.AppendToFile = true;
roller.RollingStyle = RollingFileAppender.RollingMode.Date; roller.RollingStyle = RollingFileAppender.RollingMode.Date;
@@ -30,8 +33,34 @@ namespace v2rayN.Tool
memory.ActivateOptions(); memory.ActivateOptions();
hierarchy.Root.AddAppender(memory); hierarchy.Root.AddAppender(memory);
hierarchy.Root.Level = Level.Info; hierarchy.Root.Level = Level.Debug;
hierarchy.Configured = true; hierarchy.Configured = true;
} }
public static void ClearLogs()
{
Task.Run(() =>
{
try
{
var now = DateTime.Now.AddMonths(-1);
var dir = Utils.GetPath(@"guiLogs\");
var files = Directory.GetFiles(dir, "*.txt");
foreach (var filePath in files)
{
var file = new FileInfo(filePath);
if (file.CreationTime < now)
{
try
{
file.Delete();
}
catch { }
}
}
}
catch { }
});
}
} }
} }

View File

@@ -1,26 +0,0 @@
using System.Collections.Generic;
using System.Reflection;
using System.Resources;
namespace v2rayN
{
public class UIRes
{
static ResourceManager res = new ResourceManager("v2rayN.Resx.ResUI", Assembly.GetExecutingAssembly());
static string LoadString(ResourceManager resMgr, string key)
{
string value = resMgr.GetString(key);
if (value == null)
{
throw new KeyNotFoundException($"key: {key}");
}
return value;
}
public static string I18N(string key)
{
return LoadString(res, key);
}
}
}

View File

@@ -219,6 +219,26 @@ namespace v2rayN
} }
} }
/// <summary>
/// 逗号分隔的字符串,先排序后转List<string>
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static List<string> String2ListSorted(string str)
{
try
{
str = str.Replace(Environment.NewLine, "");
List<string> list = new List<string>(str.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
return list.OrderBy(x => x).ToList();
}
catch (Exception ex)
{
SaveLog(ex.Message, ex);
return new List<string>();
}
}
/// <summary> /// <summary>
/// Base64编码 /// Base64编码
/// </summary> /// </summary>
@@ -370,7 +390,8 @@ namespace v2rayN
public static string UrlEncode(string url) public static string UrlEncode(string url)
{ {
return HttpUtility.UrlEncode(url); return Uri.EscapeDataString(url);
//return HttpUtility.UrlEncode(url);
} }
public static string UrlDecode(string url) public static string UrlDecode(string url)
{ {
@@ -732,16 +753,11 @@ namespace v2rayN
{ {
if (enableSecurityProtocolTls13) if (enableSecurityProtocolTls13)
{ {
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Tls13;
} }
else else
{ {
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
} }
ServicePointManager.DefaultConnectionLimit = 256; ServicePointManager.DefaultConnectionLimit = 256;
} }

View File

@@ -99,6 +99,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Base\HttpClientHelper.cs" />
<Compile Include="Base\ListViewFlickerFree.cs"> <Compile Include="Base\ListViewFlickerFree.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
@@ -108,6 +109,12 @@
<Compile Include="Forms\BaseServerForm.Designer.cs"> <Compile Include="Forms\BaseServerForm.Designer.cs">
<DependentUpon>BaseServerForm.cs</DependentUpon> <DependentUpon>BaseServerForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Forms\MainMsgControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\MainMsgControl.Designer.cs">
<DependentUpon>MainMsgControl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\MsgFilterSetForm.cs"> <Compile Include="Forms\MsgFilterSetForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -195,9 +202,6 @@
<Compile Include="Handler\StatisticsHandler.cs" /> <Compile Include="Handler\StatisticsHandler.cs" />
<Compile Include="Handler\DownloadHandle.cs" /> <Compile Include="Handler\DownloadHandle.cs" />
<Compile Include="Handler\ProxySetting.cs" /> <Compile Include="Handler\ProxySetting.cs" />
<Compile Include="Base\WebClientEx.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Handler\SysProxyHandle.cs" /> <Compile Include="Handler\SysProxyHandle.cs" />
<Compile Include="Mode\ESpeedActionType.cs" /> <Compile Include="Mode\ESpeedActionType.cs" />
<Compile Include="Mode\EGlobalHotkey.cs" /> <Compile Include="Mode\EGlobalHotkey.cs" />
@@ -262,7 +266,6 @@
<Compile Include="Tool\Job.cs" /> <Compile Include="Tool\Job.cs" />
<Compile Include="Tool\Logging.cs" /> <Compile Include="Tool\Logging.cs" />
<Compile Include="Tool\QueryableExtension.cs" /> <Compile Include="Tool\QueryableExtension.cs" />
<Compile Include="Tool\UIRes.cs" />
<Compile Include="Tool\UI.cs" /> <Compile Include="Tool\UI.cs" />
<Compile Include="Tool\Utils.cs" /> <Compile Include="Tool\Utils.cs" />
<Compile Include="Handler\V2rayConfigHandler.cs" /> <Compile Include="Handler\V2rayConfigHandler.cs" />
@@ -289,6 +292,12 @@
<DependentUpon>MainForm.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Forms\MainMsgControl.resx">
<DependentUpon>MainMsgControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\MainMsgControl.zh-Hans.resx">
<DependentUpon>MainMsgControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\MsgFilterSetForm.resx"> <EmbeddedResource Include="Forms\MsgFilterSetForm.resx">
<DependentUpon>MsgFilterSetForm.cs</DependentUpon> <DependentUpon>MsgFilterSetForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -465,6 +474,7 @@
<None Include="Resources\minimize.png" /> <None Include="Resources\minimize.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Sample\SampleInbound.txt" />
<None Include="Resources\share.png" /> <None Include="Resources\share.png" />
<None Include="Resources\promotion.png" /> <None Include="Resources\promotion.png" />
<None Include="Resources\sub.png" /> <None Include="Resources\sub.png" />
@@ -475,13 +485,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Google.Protobuf"> <PackageReference Include="Google.Protobuf">
<Version>3.19.4</Version> <Version>3.20.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Grpc.Core"> <PackageReference Include="Grpc.Core">
<Version>2.44.0</Version> <Version>2.45.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Grpc.Tools"> <PackageReference Include="Grpc.Tools">
<Version>2.44.0</Version> <Version>2.45.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>