Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
069d47f01b | ||
|
|
3079f1c651 | ||
|
|
f5ecda9255 | ||
|
|
d83ae315ed | ||
|
|
2b40e87eb9 | ||
|
|
f7e3eb180b | ||
|
|
209786cdb6 | ||
|
|
d418f79d8f | ||
|
|
eddd38ff03 | ||
|
|
e4fa729071 | ||
|
|
b3e7eac895 | ||
|
|
c43675d987 | ||
|
|
cdaff66126 | ||
|
|
cf45e89b16 | ||
|
|
aec8459761 | ||
|
|
de746375a9 | ||
|
|
25c2871888 | ||
|
|
28b2e1a405 | ||
|
|
2603132dae | ||
|
|
6f08cb0e88 | ||
|
|
dd65c3fcaa | ||
|
|
fec8641efe | ||
|
|
d5eaa56b60 | ||
|
|
db7e8dd6dc | ||
|
|
9415055e6f | ||
|
|
f597f09914 | ||
|
|
7903228c13 | ||
|
|
4c2388749d | ||
|
|
89da3823a4 | ||
|
|
3a9a49b163 | ||
|
|
277b21dc86 | ||
|
|
bc0e8c17ba | ||
|
|
51d3df69bb | ||
|
|
4913f6f37d | ||
|
|
ff622e2ef6 | ||
|
|
50ad643abe | ||
|
|
944849a381 | ||
|
|
6f485141f0 | ||
|
|
3575291119 | ||
|
|
e256ec5401 | ||
|
|
3defba6290 | ||
|
|
c201d986c5 | ||
|
|
36aad4424e | ||
|
|
b29fb1e2a3 |
@@ -45,16 +45,9 @@ namespace v2rayN.Base
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
HttpResponseMessage response = await httpClient.GetAsync(url);
|
||||
HttpResponseMessage response = await httpClient.GetAsync(url);
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return null;
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
public async Task<string> GetAsync(HttpClient client, string url, CancellationToken token)
|
||||
{
|
||||
@@ -62,16 +55,12 @@ namespace v2rayN.Base
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
HttpResponseMessage response = await client.GetAsync(url, token);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
HttpResponseMessage response = await client.GetAsync(url, token);
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
throw new Exception(string.Format("The request returned with HTTP status code {0}", response.StatusCode));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog("GetAsync", ex);
|
||||
}
|
||||
return null;
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
public async Task PutAsync(string url, Dictionary<string, string> headers)
|
||||
|
||||
@@ -16,37 +16,37 @@ namespace v2rayN.Base
|
||||
UpdateStyles();
|
||||
}
|
||||
|
||||
public void RegisterDragEvent(Action<int, int> _update)
|
||||
public void RegisterDragEvent(Action<int, int> update)
|
||||
{
|
||||
_updateFunc = _update;
|
||||
this.AllowDrop = true;
|
||||
_updateFunc = update;
|
||||
AllowDrop = true;
|
||||
|
||||
this.ItemDrag += new ItemDragEventHandler(this.lv_ItemDrag);
|
||||
this.DragDrop += new DragEventHandler(this.lv_DragDrop);
|
||||
this.DragEnter += new DragEventHandler(this.lv_DragEnter);
|
||||
this.DragOver += new DragEventHandler(this.lv_DragOver);
|
||||
this.DragLeave += new EventHandler(this.lv_DragLeave);
|
||||
ItemDrag += lv_ItemDrag;
|
||||
DragDrop += lv_DragDrop;
|
||||
DragEnter += lv_DragEnter;
|
||||
DragOver += lv_DragOver;
|
||||
DragLeave += lv_DragLeave;
|
||||
}
|
||||
|
||||
private void lv_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
int targetIndex = this.InsertionMark.Index;
|
||||
int targetIndex = InsertionMark.Index;
|
||||
if (targetIndex == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.InsertionMark.AppearsAfterItem)
|
||||
if (InsertionMark.AppearsAfterItem)
|
||||
{
|
||||
targetIndex++;
|
||||
}
|
||||
|
||||
|
||||
if (this.SelectedIndices.Count <= 0)
|
||||
if (SelectedIndices.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_updateFunc(this.SelectedIndices[0], targetIndex);
|
||||
_updateFunc(SelectedIndices[0], targetIndex);
|
||||
|
||||
//ListViewItem draggedItem = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
|
||||
//this.BeginUpdate();
|
||||
@@ -63,35 +63,35 @@ namespace v2rayN.Base
|
||||
|
||||
private void lv_DragLeave(object sender, EventArgs e)
|
||||
{
|
||||
this.InsertionMark.Index = -1;
|
||||
InsertionMark.Index = -1;
|
||||
}
|
||||
|
||||
private void lv_DragOver(object sender, DragEventArgs e)
|
||||
{
|
||||
Point targetPoint = this.PointToClient(new Point(e.X, e.Y));
|
||||
int targetIndex = this.InsertionMark.NearestIndex(targetPoint);
|
||||
Point targetPoint = PointToClient(new Point(e.X, e.Y));
|
||||
int targetIndex = InsertionMark.NearestIndex(targetPoint);
|
||||
|
||||
if (targetIndex > -1)
|
||||
{
|
||||
Rectangle itemBounds = this.GetItemRect(targetIndex);
|
||||
this.EnsureVisible(targetIndex);
|
||||
Rectangle itemBounds = GetItemRect(targetIndex);
|
||||
EnsureVisible(targetIndex);
|
||||
|
||||
if (targetPoint.Y > itemBounds.Top + (itemBounds.Height / 2))
|
||||
{
|
||||
this.InsertionMark.AppearsAfterItem = true;
|
||||
InsertionMark.AppearsAfterItem = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.InsertionMark.AppearsAfterItem = false;
|
||||
InsertionMark.AppearsAfterItem = false;
|
||||
}
|
||||
}
|
||||
this.InsertionMark.Index = targetIndex;
|
||||
InsertionMark.Index = targetIndex;
|
||||
}
|
||||
|
||||
private void lv_ItemDrag(object sender, ItemDragEventArgs e)
|
||||
{
|
||||
this.DoDragDrop(e.Item, DragDropEffects.Move);
|
||||
this.InsertionMark.Index = -1;
|
||||
DoDragDrop(e.Item, DragDropEffects.Move);
|
||||
InsertionMark.Index = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,8 +32,10 @@ namespace v2rayN.Forms
|
||||
}
|
||||
else
|
||||
{
|
||||
vmessItem = new VmessItem();
|
||||
vmessItem.groupId = groupId;
|
||||
vmessItem = new VmessItem
|
||||
{
|
||||
groupId = groupId
|
||||
};
|
||||
ClearServer();
|
||||
}
|
||||
}
|
||||
@@ -46,14 +48,7 @@ namespace v2rayN.Forms
|
||||
txtRemarks.Text = vmessItem.remarks;
|
||||
txtAddress.Text = vmessItem.address;
|
||||
|
||||
if (vmessItem.coreType == null)
|
||||
{
|
||||
cmbCoreType.Text = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbCoreType.Text = vmessItem.coreType.ToString();
|
||||
}
|
||||
cmbCoreType.Text = vmessItem.coreType == null ? string.Empty : vmessItem.coreType.ToString();
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +85,7 @@ namespace v2rayN.Forms
|
||||
|
||||
if (ConfigHandler.EditCustomServer(ref config, vmessItem) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -100,14 +95,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(vmessItem.indexId))
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
DialogResult = Utils.IsNullOrEmpty(vmessItem.indexId) ? DialogResult.Cancel : DialogResult.OK;
|
||||
}
|
||||
|
||||
private void btnBrowse_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace v2rayN.Forms
|
||||
|
||||
private void AddServerForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Text = (eConfigType).ToString();
|
||||
Text = (eConfigType).ToString();
|
||||
|
||||
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray());
|
||||
cmbCoreType.Items.Add(string.Empty);
|
||||
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
case EConfigType.VMess:
|
||||
panVmess.Dock = DockStyle.Fill;
|
||||
panVmess.Visible = true;
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace v2rayN.Forms
|
||||
case EConfigType.Shadowsocks:
|
||||
panSs.Dock = DockStyle.Fill;
|
||||
panSs.Visible = true;
|
||||
panTran.Visible = false;
|
||||
this.Height = this.Height - panTran.Height;
|
||||
//panTran.Visible = false;
|
||||
//this.Height = this.Height - panTran.Height;
|
||||
|
||||
cmbSecurity3.Items.AddRange(LazyConfig.Instance.GetShadowsocksSecuritys().ToArray());
|
||||
break;
|
||||
@@ -41,7 +41,7 @@ namespace v2rayN.Forms
|
||||
panSocks.Dock = DockStyle.Fill;
|
||||
panSocks.Visible = true;
|
||||
panTran.Visible = false;
|
||||
this.Height = this.Height - panTran.Height;
|
||||
Height = Height - panTran.Height;
|
||||
break;
|
||||
case EConfigType.VLESS:
|
||||
panVless.Dock = DockStyle.Fill;
|
||||
@@ -65,8 +65,10 @@ namespace v2rayN.Forms
|
||||
}
|
||||
else
|
||||
{
|
||||
vmessItem = new VmessItem();
|
||||
vmessItem.groupId = groupId;
|
||||
vmessItem = new VmessItem
|
||||
{
|
||||
groupId = groupId
|
||||
};
|
||||
ClearServer();
|
||||
}
|
||||
}
|
||||
@@ -82,7 +84,7 @@ namespace v2rayN.Forms
|
||||
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
case EConfigType.VMess:
|
||||
txtId.Text = vmessItem.id;
|
||||
txtAlterId.Text = vmessItem.alterId.ToString();
|
||||
cmbSecurity.Text = vmessItem.security;
|
||||
@@ -106,14 +108,7 @@ namespace v2rayN.Forms
|
||||
break;
|
||||
}
|
||||
|
||||
if (vmessItem.coreType == null)
|
||||
{
|
||||
cmbCoreType.Text = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbCoreType.Text = vmessItem.coreType.ToString();
|
||||
}
|
||||
cmbCoreType.Text = vmessItem.coreType == null ? string.Empty : vmessItem.coreType.ToString();
|
||||
|
||||
transportControl.BindingServer(vmessItem);
|
||||
}
|
||||
@@ -129,7 +124,7 @@ namespace v2rayN.Forms
|
||||
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
case EConfigType.VMess:
|
||||
txtId.Text = "";
|
||||
txtAlterId.Text = "0";
|
||||
cmbSecurity.Text = Global.DefaultSecurity;
|
||||
@@ -169,7 +164,7 @@ namespace v2rayN.Forms
|
||||
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
case EConfigType.VMess:
|
||||
id = txtId.Text;
|
||||
alterId = txtAlterId.Text;
|
||||
security = cmbSecurity.Text;
|
||||
@@ -246,7 +241,7 @@ namespace v2rayN.Forms
|
||||
int ret = -1;
|
||||
switch (eConfigType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
case EConfigType.VMess:
|
||||
ret = ConfigHandler.AddServer(ref config, vmessItem);
|
||||
break;
|
||||
case EConfigType.Shadowsocks:
|
||||
@@ -267,7 +262,7 @@ namespace v2rayN.Forms
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -284,7 +279,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ namespace v2rayN.Forms
|
||||
string file = Utils.GetPath(Global.CustomIconName);
|
||||
if (System.IO.File.Exists(file))
|
||||
{
|
||||
this.Icon = new System.Drawing.Icon(file);
|
||||
Icon = new System.Drawing.Icon(file);
|
||||
return;
|
||||
}
|
||||
|
||||
this.Icon = Properties.Resources.NotifyIcon1;
|
||||
Icon = Properties.Resources.NotifyIcon1;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace v2rayN.Forms
|
||||
|
||||
if (ConfigHandler.SaveConfig(ref config, false) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -111,7 +111,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void btnReset_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void GroupSettingControl_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Height = grbMain.Height;
|
||||
Height = grbMain.Height;
|
||||
BindingSub();
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
if (ConfigHandler.SaveGroupItem(ref config) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -80,7 +80,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
|
||||
164
v2rayN/v2rayN/Forms/MainForm.Designer.cs
generated
164
v2rayN/v2rayN/Forms/MainForm.Designer.cs
generated
@@ -30,7 +30,7 @@
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
this.scMain = new System.Windows.Forms.SplitContainer();
|
||||
this.scServers = new System.Windows.Forms.SplitContainer();
|
||||
this.lvServers = new v2rayN.Base.ListViewFlickerFree();
|
||||
this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.menuAddVmessServer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -46,8 +46,10 @@
|
||||
this.menuRemoveDuplicateServer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuCopyServer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuSetDefaultServer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuServerFilter = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.menuMoveToGroup = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuMoveEvent = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuMoveTop = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuMoveUp = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuMoveDown = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -58,6 +60,7 @@
|
||||
this.menuTcpingServer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuRealPingServer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuSpeedServer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuSortServerResult = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsbTestMe = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuClearServerStatistics = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
|
||||
@@ -68,8 +71,8 @@
|
||||
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
|
||||
this.tabGroup = new System.Windows.Forms.TabControl();
|
||||
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.scBig = new System.Windows.Forms.SplitContainer();
|
||||
this.gbServers = new System.Windows.Forms.GroupBox();
|
||||
this.mainMsgControl = new v2rayN.Forms.MainMsgControl();
|
||||
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
@@ -109,6 +112,9 @@
|
||||
this.tsbCheckUpdateN = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsbCheckUpdateCore = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsbCheckUpdateXrayCore = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.tsbCheckUpdateClashCore = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsbCheckUpdateClashMetaCore = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.tsbCheckUpdateGeo = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
|
||||
@@ -121,35 +127,35 @@
|
||||
this.tsbPromotion = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.tsbClose = new System.Windows.Forms.ToolStripButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
|
||||
this.scMain.Panel1.SuspendLayout();
|
||||
this.scMain.Panel2.SuspendLayout();
|
||||
this.scMain.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.scServers)).BeginInit();
|
||||
this.scServers.Panel1.SuspendLayout();
|
||||
this.scServers.Panel2.SuspendLayout();
|
||||
this.scServers.SuspendLayout();
|
||||
this.cmsLv.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.scBig)).BeginInit();
|
||||
this.scBig.Panel1.SuspendLayout();
|
||||
this.scBig.Panel2.SuspendLayout();
|
||||
this.scBig.SuspendLayout();
|
||||
this.gbServers.SuspendLayout();
|
||||
this.cmsMain.SuspendLayout();
|
||||
this.tsMain.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// scMain
|
||||
// scServers
|
||||
//
|
||||
resources.ApplyResources(this.scMain, "scMain");
|
||||
this.scMain.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.scMain.Name = "scMain";
|
||||
resources.ApplyResources(this.scServers, "scServers");
|
||||
this.scServers.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.scServers.Name = "scServers";
|
||||
//
|
||||
// scMain.Panel1
|
||||
// scServers.Panel1
|
||||
//
|
||||
this.scMain.Panel1.Controls.Add(this.lvServers);
|
||||
this.scMain.Panel1.Controls.Add(this.tabGroup);
|
||||
this.scServers.Panel1.Controls.Add(this.lvServers);
|
||||
this.scServers.Panel1.Controls.Add(this.tabGroup);
|
||||
//
|
||||
// scMain.Panel2
|
||||
// scServers.Panel2
|
||||
//
|
||||
this.scMain.Panel2.Controls.Add(this.qrCodeControl);
|
||||
this.scMain.TabStop = false;
|
||||
this.scServers.Panel2.Controls.Add(this.qrCodeControl);
|
||||
this.scServers.TabStop = false;
|
||||
//
|
||||
// lvServers
|
||||
//
|
||||
@@ -188,18 +194,17 @@
|
||||
this.menuRemoveDuplicateServer,
|
||||
this.menuCopyServer,
|
||||
this.menuSetDefaultServer,
|
||||
this.menuServerFilter,
|
||||
this.toolStripSeparator3,
|
||||
this.menuMoveToGroup,
|
||||
this.menuMoveTop,
|
||||
this.menuMoveUp,
|
||||
this.menuMoveDown,
|
||||
this.menuMoveBottom,
|
||||
this.menuMoveEvent,
|
||||
this.menuSelectAll,
|
||||
this.toolStripSeparator9,
|
||||
this.menuPingServer,
|
||||
this.menuTcpingServer,
|
||||
this.menuRealPingServer,
|
||||
this.menuSpeedServer,
|
||||
this.menuSortServerResult,
|
||||
this.tsbTestMe,
|
||||
this.menuClearServerStatistics,
|
||||
this.toolStripSeparator6,
|
||||
@@ -208,6 +213,7 @@
|
||||
this.menuExport2ShareUrl,
|
||||
this.menuExport2SubContent});
|
||||
this.cmsLv.Name = "cmsLv";
|
||||
this.cmsLv.OwnerItem = this.tsbServer;
|
||||
resources.ApplyResources(this.cmsLv, "cmsLv");
|
||||
//
|
||||
// menuAddVmessServer
|
||||
@@ -287,6 +293,12 @@
|
||||
resources.ApplyResources(this.menuSetDefaultServer, "menuSetDefaultServer");
|
||||
this.menuSetDefaultServer.Click += new System.EventHandler(this.menuSetDefaultServer_Click);
|
||||
//
|
||||
// menuServerFilter
|
||||
//
|
||||
this.menuServerFilter.Name = "menuServerFilter";
|
||||
resources.ApplyResources(this.menuServerFilter, "menuServerFilter");
|
||||
this.menuServerFilter.Click += new System.EventHandler(this.menuServerFilter_Click);
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
@@ -298,6 +310,16 @@
|
||||
resources.ApplyResources(this.menuMoveToGroup, "menuMoveToGroup");
|
||||
this.menuMoveToGroup.Click += new System.EventHandler(this.menuMoveToGroup_Click);
|
||||
//
|
||||
// menuMoveEvent
|
||||
//
|
||||
this.menuMoveEvent.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menuMoveTop,
|
||||
this.menuMoveUp,
|
||||
this.menuMoveDown,
|
||||
this.menuMoveBottom});
|
||||
this.menuMoveEvent.Name = "menuMoveEvent";
|
||||
resources.ApplyResources(this.menuMoveEvent, "menuMoveEvent");
|
||||
//
|
||||
// menuMoveTop
|
||||
//
|
||||
this.menuMoveTop.Name = "menuMoveTop";
|
||||
@@ -357,6 +379,12 @@
|
||||
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
|
||||
this.menuSpeedServer.Click += new System.EventHandler(this.menuSpeedServer_Click);
|
||||
//
|
||||
// menuSortServerResult
|
||||
//
|
||||
this.menuSortServerResult.Name = "menuSortServerResult";
|
||||
resources.ApplyResources(this.menuSortServerResult, "menuSortServerResult");
|
||||
this.menuSortServerResult.Click += new System.EventHandler(this.menuSortServerResult_Click);
|
||||
//
|
||||
// tsbTestMe
|
||||
//
|
||||
this.tsbTestMe.Name = "tsbTestMe";
|
||||
@@ -417,25 +445,25 @@
|
||||
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
|
||||
this.qrCodeControl.Name = "qrCodeControl";
|
||||
//
|
||||
// splitContainer1
|
||||
// scBig
|
||||
//
|
||||
resources.ApplyResources(this.splitContainer1, "splitContainer1");
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
resources.ApplyResources(this.scBig, "scBig");
|
||||
this.scBig.Name = "scBig";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
// scBig.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.groupBox1);
|
||||
this.scBig.Panel1.Controls.Add(this.gbServers);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
// scBig.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.mainMsgControl);
|
||||
this.scBig.Panel2.Controls.Add(this.mainMsgControl);
|
||||
//
|
||||
// groupBox1
|
||||
// gbServers
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.scMain);
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
this.gbServers.Controls.Add(this.scServers);
|
||||
resources.ApplyResources(this.gbServers, "gbServers");
|
||||
this.gbServers.Name = "gbServers";
|
||||
this.gbServers.TabStop = false;
|
||||
//
|
||||
// mainMsgControl
|
||||
//
|
||||
@@ -691,6 +719,9 @@
|
||||
this.tsbCheckUpdateN,
|
||||
this.tsbCheckUpdateCore,
|
||||
this.tsbCheckUpdateXrayCore,
|
||||
this.toolStripSeparator16,
|
||||
this.tsbCheckUpdateClashCore,
|
||||
this.tsbCheckUpdateClashMetaCore,
|
||||
this.toolStripSeparator15,
|
||||
this.tsbCheckUpdateGeo});
|
||||
this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate;
|
||||
@@ -715,6 +746,23 @@
|
||||
resources.ApplyResources(this.tsbCheckUpdateXrayCore, "tsbCheckUpdateXrayCore");
|
||||
this.tsbCheckUpdateXrayCore.Click += new System.EventHandler(this.tsbCheckUpdateXrayCore_Click);
|
||||
//
|
||||
// toolStripSeparator16
|
||||
//
|
||||
this.toolStripSeparator16.Name = "toolStripSeparator16";
|
||||
resources.ApplyResources(this.toolStripSeparator16, "toolStripSeparator16");
|
||||
//
|
||||
// tsbCheckUpdateClashCore
|
||||
//
|
||||
this.tsbCheckUpdateClashCore.Name = "tsbCheckUpdateClashCore";
|
||||
resources.ApplyResources(this.tsbCheckUpdateClashCore, "tsbCheckUpdateClashCore");
|
||||
this.tsbCheckUpdateClashCore.Click += new System.EventHandler(this.tsbCheckUpdateClashCore_Click);
|
||||
//
|
||||
// tsbCheckUpdateClashMetaCore
|
||||
//
|
||||
this.tsbCheckUpdateClashMetaCore.Name = "tsbCheckUpdateClashMetaCore";
|
||||
resources.ApplyResources(this.tsbCheckUpdateClashMetaCore, "tsbCheckUpdateClashMetaCore");
|
||||
this.tsbCheckUpdateClashMetaCore.Click += new System.EventHandler(this.tsbCheckUpdateClashMetaCore_Click);
|
||||
//
|
||||
// toolStripSeparator15
|
||||
//
|
||||
this.toolStripSeparator15.Name = "toolStripSeparator15";
|
||||
@@ -796,7 +844,7 @@
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Controls.Add(this.scBig);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.tsMain);
|
||||
this.MaximizeBox = true;
|
||||
@@ -807,16 +855,16 @@
|
||||
this.Shown += new System.EventHandler(this.MainForm_Shown);
|
||||
this.VisibleChanged += new System.EventHandler(this.MainForm_VisibleChanged);
|
||||
this.Resize += new System.EventHandler(this.MainForm_Resize);
|
||||
this.scMain.Panel1.ResumeLayout(false);
|
||||
this.scMain.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit();
|
||||
this.scMain.ResumeLayout(false);
|
||||
this.scServers.Panel1.ResumeLayout(false);
|
||||
this.scServers.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.scServers)).EndInit();
|
||||
this.scServers.ResumeLayout(false);
|
||||
this.cmsLv.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.scBig.Panel1.ResumeLayout(false);
|
||||
this.scBig.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.scBig)).EndInit();
|
||||
this.scBig.ResumeLayout(false);
|
||||
this.gbServers.ResumeLayout(false);
|
||||
this.cmsMain.ResumeLayout(false);
|
||||
this.tsMain.ResumeLayout(false);
|
||||
this.tsMain.PerformLayout();
|
||||
@@ -827,7 +875,7 @@
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox gbServers;
|
||||
private v2rayN.Base.ListViewFlickerFree lvServers;
|
||||
private System.Windows.Forms.NotifyIcon notifyMain;
|
||||
private System.Windows.Forms.ContextMenuStrip cmsMain;
|
||||
@@ -851,10 +899,6 @@
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveTop;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveUp;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveDown;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveBottom;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuSysAgentMode;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuGlobal;
|
||||
@@ -862,7 +906,7 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem menuAddCustomServer;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuAddShadowsocksServer;
|
||||
private System.Windows.Forms.SplitContainer scMain;
|
||||
private System.Windows.Forms.SplitContainer scServers;
|
||||
private QRCodeControl qrCodeControl;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
|
||||
private System.Windows.Forms.ToolStripDropDownButton tsbCheckUpdate;
|
||||
@@ -910,7 +954,7 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbBackupGuiNConfig;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator15;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateGeo;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.SplitContainer scBig;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbSubUpdateViaProxy;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuUpdateSubViaProxy;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbGlobalHotkeySetting;
|
||||
@@ -918,6 +962,16 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbGroupSetting;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveToGroup;
|
||||
private MainMsgControl mainMsgControl;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveEvent;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveTop;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveUp;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveDown;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuMoveBottom;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuServerFilter;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateClashCore;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateClashMetaCore;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator16;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuSortServerResult;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,19 +18,20 @@ namespace v2rayN.Forms
|
||||
{
|
||||
private V2rayHandler v2rayHandler;
|
||||
private List<VmessItem> lstSelecteds = new List<VmessItem>();
|
||||
private StatisticsHandler statistics = null;
|
||||
private List<VmessItem> lstVmess = null;
|
||||
private StatisticsHandler statistics;
|
||||
private List<VmessItem> lstVmess;
|
||||
private string groupId = string.Empty;
|
||||
private string serverFilter = string.Empty;
|
||||
|
||||
#region Window 事件
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.ShowInTaskbar = false;
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
ShowInTaskbar = false;
|
||||
WindowState = FormWindowState.Minimized;
|
||||
HideForm();
|
||||
this.Text = Utils.GetVersion();
|
||||
Text = Utils.GetVersion();
|
||||
Global.processJob = new Job();
|
||||
|
||||
Application.ApplicationExit += (sender, args) =>
|
||||
@@ -123,7 +124,10 @@ namespace v2rayN.Forms
|
||||
{
|
||||
try
|
||||
{
|
||||
v2rayHandler.V2rayStop();
|
||||
Utils.SaveLog("MyAppExit Begin");
|
||||
|
||||
StorageUI();
|
||||
ConfigHandler.SaveConfig(ref config);
|
||||
|
||||
//HttpProxyHandle.CloseHttpAgent(config);
|
||||
if (blWindowsShutDown)
|
||||
@@ -135,26 +139,27 @@ namespace v2rayN.Forms
|
||||
SysProxyHandle.UpdateSysProxy(config, true);
|
||||
}
|
||||
|
||||
StorageUI();
|
||||
ConfigHandler.SaveConfig(ref config);
|
||||
statistics?.SaveToFile();
|
||||
statistics?.Close();
|
||||
|
||||
v2rayHandler.V2rayStop();
|
||||
Utils.SaveLog("MyAppExit End");
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void RestoreUI()
|
||||
{
|
||||
scMain.Panel2Collapsed = true;
|
||||
scServers.Panel2Collapsed = true;
|
||||
|
||||
if (!config.uiItem.mainLocation.IsEmpty)
|
||||
{
|
||||
this.Location = config.uiItem.mainLocation;
|
||||
Location = config.uiItem.mainLocation;
|
||||
}
|
||||
if (!config.uiItem.mainSize.IsEmpty)
|
||||
{
|
||||
this.Width = config.uiItem.mainSize.Width;
|
||||
this.Height = config.uiItem.mainSize.Height;
|
||||
Width = config.uiItem.mainSize.Width;
|
||||
Height = config.uiItem.mainSize.Height;
|
||||
}
|
||||
|
||||
|
||||
@@ -167,9 +172,9 @@ namespace v2rayN.Forms
|
||||
|
||||
private void StorageUI()
|
||||
{
|
||||
config.uiItem.mainLocation = this.Location;
|
||||
config.uiItem.mainLocation = Location;
|
||||
|
||||
config.uiItem.mainSize = new Size(this.Width, this.Height);
|
||||
config.uiItem.mainSize = new Size(Width, Height);
|
||||
|
||||
for (int k = 0; k < lvServers.Columns.Count; k++)
|
||||
{
|
||||
@@ -182,7 +187,7 @@ namespace v2rayN.Forms
|
||||
switch (Utils.ToInt(e.Name))
|
||||
{
|
||||
case (int)EGlobalHotkey.ShowForm:
|
||||
if (this.ShowInTaskbar) HideForm(); else ShowForm();
|
||||
if (ShowInTaskbar) HideForm(); else ShowForm();
|
||||
break;
|
||||
case (int)EGlobalHotkey.SystemProxyClear:
|
||||
SetListenerType(ESysProxyType.ForcedClear);
|
||||
@@ -207,7 +212,8 @@ namespace v2rayN.Forms
|
||||
private void RefreshServers()
|
||||
{
|
||||
lstVmess = config.vmess
|
||||
.Where(it => Utils.IsNullOrEmpty(groupId) ? true : it.groupId == groupId)
|
||||
.Where(it => Utils.IsNullOrEmpty(groupId) || it.groupId == groupId)
|
||||
.Where(it => Utils.IsNullOrEmpty(serverFilter) || it.remarks.Contains(serverFilter))
|
||||
.OrderBy(it => it.sort)
|
||||
.ToList();
|
||||
|
||||
@@ -365,7 +371,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
ts.Checked = true;
|
||||
}
|
||||
ts.Click += new EventHandler(ts_Click);
|
||||
ts.Click += ts_Click;
|
||||
lst.Add(ts);
|
||||
}
|
||||
menuServers.DropDownItems.AddRange(lst.ToArray());
|
||||
@@ -409,7 +415,7 @@ namespace v2rayN.Forms
|
||||
}
|
||||
|
||||
var tag = lvServers.Columns[e.Column].Tag?.ToString();
|
||||
bool asc = Utils.IsNullOrEmpty(tag) ? true : !Convert.ToBoolean(tag);
|
||||
bool asc = Utils.IsNullOrEmpty(tag) || !Convert.ToBoolean(tag);
|
||||
if (ConfigHandler.SortServers(ref config, ref lstVmess, (EServerColName)e.Column, asc) != 0)
|
||||
{
|
||||
return;
|
||||
@@ -459,7 +465,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
Tag = item.id,
|
||||
};
|
||||
ts.Click += new EventHandler(ts_Group_Click);
|
||||
ts.Click += ts_Group_Click;
|
||||
lst.Add(ts);
|
||||
}
|
||||
menuMoveToGroup.DropDownItems.AddRange(lst.ToArray());
|
||||
@@ -510,7 +516,7 @@ namespace v2rayN.Forms
|
||||
/// </summary>
|
||||
async Task LoadV2ray()
|
||||
{
|
||||
this.BeginInvoke(new Action(() =>
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
tsbReload.Enabled = false;
|
||||
}));
|
||||
@@ -530,7 +536,7 @@ namespace v2rayN.Forms
|
||||
|
||||
ChangePACButtonStatus(config.sysProxyType);
|
||||
|
||||
this.BeginInvoke(new Action(() =>
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
tsbReload.Enabled = true;
|
||||
}));
|
||||
@@ -624,6 +630,12 @@ namespace v2rayN.Forms
|
||||
case Keys.T:
|
||||
menuSpeedServer_Click(null, null);
|
||||
break;
|
||||
case Keys.F:
|
||||
menuServerFilter_Click(null, null);
|
||||
break;
|
||||
case Keys.E:
|
||||
menuSortServerResult_Click(null, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -654,7 +666,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void menuAddVmessServer_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowServerForm(EConfigType.Vmess, -1);
|
||||
ShowServerForm(EConfigType.VMess, -1);
|
||||
}
|
||||
|
||||
private void menuAddVlessServer_Click(object sender, EventArgs e)
|
||||
@@ -713,6 +725,17 @@ namespace v2rayN.Forms
|
||||
SetDefaultServer(index);
|
||||
}
|
||||
|
||||
private void menuServerFilter_Click(object sender, EventArgs e)
|
||||
{
|
||||
var fm = new MsgFilterSetForm();
|
||||
fm.MsgFilter = serverFilter;
|
||||
if (fm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
serverFilter = fm.MsgFilter;
|
||||
gbServers.Text = string.Format(ResUI.MsgServerTitle, serverFilter);
|
||||
RefreshServers();
|
||||
}
|
||||
}
|
||||
|
||||
private void menuPingServer_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -754,6 +777,10 @@ namespace v2rayN.Forms
|
||||
ClearTestResult();
|
||||
SpeedtestHandler statistics = new SpeedtestHandler(config, v2rayHandler, lstSelecteds, actionType, UpdateSpeedtestHandler);
|
||||
}
|
||||
private void menuSortServerResult_Click(object sender, EventArgs e)
|
||||
{
|
||||
lvServers_ColumnClick(null, new ColumnClickEventArgs((int)EServerColName.testResult));
|
||||
}
|
||||
|
||||
private void tsbTestMe_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -772,12 +799,20 @@ namespace v2rayN.Forms
|
||||
private void menuExport2ClientConfig_Click(object sender, EventArgs e)
|
||||
{
|
||||
int index = GetLvSelectedIndex();
|
||||
if (index < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
MainFormHandler.Instance.Export2ClientConfig(lstVmess[index], config);
|
||||
}
|
||||
|
||||
private void menuExport2ServerConfig_Click(object sender, EventArgs e)
|
||||
{
|
||||
int index = GetLvSelectedIndex();
|
||||
if (index < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
MainFormHandler.Instance.Export2ServerConfig(lstVmess[index], config);
|
||||
}
|
||||
|
||||
@@ -1065,8 +1100,8 @@ namespace v2rayN.Forms
|
||||
|
||||
private void menuExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Visible = false;
|
||||
this.Close();
|
||||
Visible = false;
|
||||
Close();
|
||||
|
||||
Application.Exit();
|
||||
}
|
||||
@@ -1074,13 +1109,13 @@ namespace v2rayN.Forms
|
||||
|
||||
private void ShowForm()
|
||||
{
|
||||
this.Show();
|
||||
if (this.WindowState == FormWindowState.Minimized)
|
||||
Show();
|
||||
if (WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
this.WindowState = FormWindowState.Normal;
|
||||
WindowState = FormWindowState.Normal;
|
||||
}
|
||||
this.Activate();
|
||||
this.ShowInTaskbar = true;
|
||||
Activate();
|
||||
ShowInTaskbar = true;
|
||||
//this.notifyIcon1.Visible = false;
|
||||
mainMsgControl.ScrollToCaret();
|
||||
|
||||
@@ -1097,12 +1132,18 @@ namespace v2rayN.Forms
|
||||
private void HideForm()
|
||||
{
|
||||
//this.WindowState = FormWindowState.Minimized;
|
||||
this.Hide();
|
||||
Hide();
|
||||
//this.notifyMain.Icon = this.Icon;
|
||||
this.notifyMain.Visible = true;
|
||||
this.ShowInTaskbar = false;
|
||||
notifyMain.Visible = true;
|
||||
ShowInTaskbar = false;
|
||||
|
||||
SetVisibleCore(false);
|
||||
|
||||
//write Handle to reg
|
||||
if (IsHandleCreated)
|
||||
{
|
||||
Utils.RegWriteValue(Global.MyRegPath, Utils.WindowHwndKey, Convert.ToString((long)Handle));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1148,8 +1189,8 @@ namespace v2rayN.Forms
|
||||
{
|
||||
try
|
||||
{
|
||||
up /= (ulong)(config.statisticsFreshRate / 1000f);
|
||||
down /= (ulong)(config.statisticsFreshRate / 1000f);
|
||||
up /= (ulong)(config.statisticsFreshRate);
|
||||
down /= (ulong)(config.statisticsFreshRate);
|
||||
mainMsgControl.SetToolSslInfo("speed", string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down)));
|
||||
|
||||
foreach (var it in statistics)
|
||||
@@ -1217,7 +1258,6 @@ namespace v2rayN.Forms
|
||||
int index = GetLvSelectedIndex();
|
||||
if (index < 0)
|
||||
{
|
||||
UI.Show(ResUI.PleaseSelectServer);
|
||||
return;
|
||||
}
|
||||
if (ConfigHandler.MoveServer(ref config, ref lstVmess, index, eMove) == 0)
|
||||
@@ -1273,9 +1313,9 @@ namespace v2rayN.Forms
|
||||
|
||||
mainMsgControl.DisplayToolStatus(config);
|
||||
|
||||
this.BeginInvoke(new Action(() =>
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
notifyMain.Icon = this.Icon = MainFormHandler.Instance.GetNotifyIcon(config, this.Icon);
|
||||
notifyMain.Icon = Icon = MainFormHandler.Instance.GetNotifyIcon(config, Icon);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -1294,10 +1334,7 @@ namespace v2rayN.Forms
|
||||
menuExit_Click(null, null);
|
||||
}
|
||||
};
|
||||
Task.Run(() =>
|
||||
{
|
||||
(new UpdateHandle()).CheckUpdateGuiN(config, _updateUI);
|
||||
});
|
||||
(new UpdateHandle()).CheckUpdateGuiN(config, _updateUI);
|
||||
}
|
||||
|
||||
private void tsbCheckUpdateCore_Click(object sender, EventArgs e)
|
||||
@@ -1310,6 +1347,16 @@ namespace v2rayN.Forms
|
||||
CheckUpdateCore(ECoreType.Xray);
|
||||
}
|
||||
|
||||
private void tsbCheckUpdateClashCore_Click(object sender, EventArgs e)
|
||||
{
|
||||
CheckUpdateCore(ECoreType.clash);
|
||||
}
|
||||
|
||||
private void tsbCheckUpdateClashMetaCore_Click(object sender, EventArgs e)
|
||||
{
|
||||
CheckUpdateCore(ECoreType.clash_meta);
|
||||
}
|
||||
|
||||
private void CheckUpdateCore(ECoreType type)
|
||||
{
|
||||
void _updateUI(bool success, string msg)
|
||||
@@ -1330,10 +1377,7 @@ namespace v2rayN.Forms
|
||||
AppendText(false, ResUI.MsgUpdateV2rayCoreSuccessfully);
|
||||
}
|
||||
};
|
||||
Task.Run(() =>
|
||||
{
|
||||
(new UpdateHandle()).CheckUpdateCore(type, config, _updateUI);
|
||||
});
|
||||
(new UpdateHandle()).CheckUpdateCore(type, config, _updateUI);
|
||||
}
|
||||
|
||||
private void tsbCheckUpdateGeo_Click(object sender, EventArgs e)
|
||||
@@ -1414,7 +1458,7 @@ namespace v2rayN.Forms
|
||||
private void tsbQRCodeSwitch_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
bool bShow = tsbQRCodeSwitch.Checked;
|
||||
scMain.Panel2Collapsed = !bShow;
|
||||
scServers.Panel2Collapsed = !bShow;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1473,7 +1517,7 @@ namespace v2rayN.Forms
|
||||
ts.Checked = true;
|
||||
mainMsgControl.SetToolSslInfo("routing", item.remarks);
|
||||
}
|
||||
ts.Click += new EventHandler(ts_Routing_Click);
|
||||
ts.Click += ts_Routing_Click;
|
||||
lst.Add(ts);
|
||||
}
|
||||
menuRoutings.DropDownItems.AddRange(lst.ToArray());
|
||||
@@ -1497,5 +1541,6 @@ namespace v2rayN.Forms
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,11 +118,11 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="scMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<data name="scServers.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="scMain.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="scServers.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>3, 17</value>
|
||||
</data>
|
||||
<metadata name="cmsLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
@@ -203,6 +203,12 @@
|
||||
<data name="menuSetDefaultServer.Text" xml:space="preserve">
|
||||
<value>Set as active server (Enter)</value>
|
||||
</data>
|
||||
<data name="menuServerFilter.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>355, 22</value>
|
||||
</data>
|
||||
<data name="menuServerFilter.Text" xml:space="preserve">
|
||||
<value>Set server filter (Ctrl+F)</value>
|
||||
</data>
|
||||
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>352, 6</value>
|
||||
</data>
|
||||
@@ -213,29 +219,35 @@
|
||||
<value>Move to Group</value>
|
||||
</data>
|
||||
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>355, 22</value>
|
||||
<value>192, 22</value>
|
||||
</data>
|
||||
<data name="menuMoveTop.Text" xml:space="preserve">
|
||||
<value>Move to top (T)</value>
|
||||
</data>
|
||||
<data name="menuMoveUp.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>355, 22</value>
|
||||
<value>192, 22</value>
|
||||
</data>
|
||||
<data name="menuMoveUp.Text" xml:space="preserve">
|
||||
<value>Up (U)</value>
|
||||
</data>
|
||||
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>355, 22</value>
|
||||
<value>192, 22</value>
|
||||
</data>
|
||||
<data name="menuMoveDown.Text" xml:space="preserve">
|
||||
<value>Down (D)</value>
|
||||
</data>
|
||||
<data name="menuMoveBottom.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>355, 22</value>
|
||||
<value>192, 22</value>
|
||||
</data>
|
||||
<data name="menuMoveBottom.Text" xml:space="preserve">
|
||||
<value>Move to bottom (B)</value>
|
||||
</data>
|
||||
<data name="menuMoveEvent.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>355, 22</value>
|
||||
</data>
|
||||
<data name="menuMoveEvent.Text" xml:space="preserve">
|
||||
<value>Move to</value>
|
||||
</data>
|
||||
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>355, 22</value>
|
||||
</data>
|
||||
@@ -269,6 +281,12 @@
|
||||
<data name="menuSpeedServer.Text" xml:space="preserve">
|
||||
<value>Test servers download speed (Ctrl+T)</value>
|
||||
</data>
|
||||
<data name="menuSortServerResult.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>355, 22</value>
|
||||
</data>
|
||||
<data name="menuSortServerResult.Text" xml:space="preserve">
|
||||
<value>Sort by test result (Ctrl+E)</value>
|
||||
</data>
|
||||
<data name="tsbTestMe.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>355, 22</value>
|
||||
</data>
|
||||
@@ -308,8 +326,20 @@
|
||||
<data name="menuExport2SubContent.Text" xml:space="preserve">
|
||||
<value>Export subscription (base64) share to clipboard</value>
|
||||
</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">
|
||||
<value>356, 666</value>
|
||||
<value>356, 644</value>
|
||||
</data>
|
||||
<data name=">>cmsLv.Name" xml:space="preserve">
|
||||
<value>cmsLv</value>
|
||||
@@ -354,7 +384,7 @@
|
||||
<value>v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>lvServers.Parent" xml:space="preserve">
|
||||
<value>scMain.Panel1</value>
|
||||
<value>scServers.Panel1</value>
|
||||
</data>
|
||||
<data name=">>lvServers.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
@@ -378,21 +408,21 @@
|
||||
<value>System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>tabGroup.Parent" xml:space="preserve">
|
||||
<value>scMain.Panel1</value>
|
||||
<value>scServers.Panel1</value>
|
||||
</data>
|
||||
<data name=">>tabGroup.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>scMain.Panel1.Name" xml:space="preserve">
|
||||
<value>scMain.Panel1</value>
|
||||
<data name=">>scServers.Panel1.Name" xml:space="preserve">
|
||||
<value>scServers.Panel1</value>
|
||||
</data>
|
||||
<data name=">>scMain.Panel1.Type" xml:space="preserve">
|
||||
<data name=">>scServers.Panel1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>scMain.Panel1.Parent" xml:space="preserve">
|
||||
<value>scMain</value>
|
||||
<data name=">>scServers.Panel1.Parent" xml:space="preserve">
|
||||
<value>scServers</value>
|
||||
</data>
|
||||
<data name=">>scMain.Panel1.ZOrder" xml:space="preserve">
|
||||
<data name=">>scServers.Panel1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="qrCodeControl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
@@ -417,102 +447,90 @@
|
||||
<value>v2rayN.Forms.QRCodeControl, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>qrCodeControl.Parent" xml:space="preserve">
|
||||
<value>scMain.Panel2</value>
|
||||
<value>scServers.Panel2</value>
|
||||
</data>
|
||||
<data name=">>qrCodeControl.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>scMain.Panel2.Name" xml:space="preserve">
|
||||
<value>scMain.Panel2</value>
|
||||
<data name=">>scServers.Panel2.Name" xml:space="preserve">
|
||||
<value>scServers.Panel2</value>
|
||||
</data>
|
||||
<data name=">>scMain.Panel2.Type" xml:space="preserve">
|
||||
<data name=">>scServers.Panel2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>scMain.Panel2.Parent" xml:space="preserve">
|
||||
<value>scMain</value>
|
||||
<data name=">>scServers.Panel2.Parent" xml:space="preserve">
|
||||
<value>scServers</value>
|
||||
</data>
|
||||
<data name=">>scMain.Panel2.ZOrder" xml:space="preserve">
|
||||
<data name=">>scServers.Panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="scMain.Panel2MinSize" type="System.Int32, mscorlib">
|
||||
<data name="scServers.Panel2MinSize" type="System.Int32, mscorlib">
|
||||
<value>100</value>
|
||||
</data>
|
||||
<data name="scMain.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="scServers.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>946, 280</value>
|
||||
</data>
|
||||
<data name="scMain.SplitterDistance" type="System.Int32, mscorlib">
|
||||
<data name="scServers.SplitterDistance" type="System.Int32, mscorlib">
|
||||
<value>686</value>
|
||||
</data>
|
||||
<data name="scMain.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="scServers.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>scMain.Name" xml:space="preserve">
|
||||
<value>scMain</value>
|
||||
<data name=">>scServers.Name" xml:space="preserve">
|
||||
<value>scServers</value>
|
||||
</data>
|
||||
<data name=">>scMain.Type" xml:space="preserve">
|
||||
<data name=">>scServers.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>scMain.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
<data name=">>scServers.Parent" xml:space="preserve">
|
||||
<value>gbServers</value>
|
||||
</data>
|
||||
<data name=">>scMain.ZOrder" xml:space="preserve">
|
||||
<data name=">>scServers.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</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="scBig.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="splitContainer1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="scBig.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 66</value>
|
||||
</data>
|
||||
<data name="splitContainer1.Orientation" type="System.Windows.Forms.Orientation, System.Windows.Forms">
|
||||
<data name="scBig.Orientation" type="System.Windows.Forms.Orientation, System.Windows.Forms">
|
||||
<value>Horizontal</value>
|
||||
</data>
|
||||
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<data name="gbServers.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="gbServers.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="gbServers.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>952, 300</value>
|
||||
</data>
|
||||
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="gbServers.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.Name" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
<data name=">>gbServers.Name" xml:space="preserve">
|
||||
<value>gbServers</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.Type" xml:space="preserve">
|
||||
<data name=">>gbServers.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=">>groupBox1.Parent" xml:space="preserve">
|
||||
<value>splitContainer1.Panel1</value>
|
||||
<data name=">>gbServers.Parent" xml:space="preserve">
|
||||
<value>scBig.Panel1</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.ZOrder" xml:space="preserve">
|
||||
<data name=">>gbServers.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel1.Name" xml:space="preserve">
|
||||
<value>splitContainer1.Panel1</value>
|
||||
<data name=">>scBig.Panel1.Name" xml:space="preserve">
|
||||
<value>scBig.Panel1</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel1.Type" xml:space="preserve">
|
||||
<data name=">>scBig.Panel1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel1.Parent" xml:space="preserve">
|
||||
<value>splitContainer1</value>
|
||||
<data name=">>scBig.Panel1.Parent" xml:space="preserve">
|
||||
<value>scBig</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel1.ZOrder" xml:space="preserve">
|
||||
<data name=">>scBig.Panel1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="mainMsgControl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
@@ -534,42 +552,42 @@
|
||||
<value>v2rayN.Forms.MainMsgControl, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>mainMsgControl.Parent" xml:space="preserve">
|
||||
<value>splitContainer1.Panel2</value>
|
||||
<value>scBig.Panel2</value>
|
||||
</data>
|
||||
<data name=">>mainMsgControl.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel2.Name" xml:space="preserve">
|
||||
<value>splitContainer1.Panel2</value>
|
||||
<data name=">>scBig.Panel2.Name" xml:space="preserve">
|
||||
<value>scBig.Panel2</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel2.Type" xml:space="preserve">
|
||||
<data name=">>scBig.Panel2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel2.Parent" xml:space="preserve">
|
||||
<value>splitContainer1</value>
|
||||
<data name=">>scBig.Panel2.Parent" xml:space="preserve">
|
||||
<value>scBig</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel2.ZOrder" xml:space="preserve">
|
||||
<data name=">>scBig.Panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="splitContainer1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="scBig.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>952, 527</value>
|
||||
</data>
|
||||
<data name="splitContainer1.SplitterDistance" type="System.Int32, mscorlib">
|
||||
<data name="scBig.SplitterDistance" type="System.Int32, mscorlib">
|
||||
<value>300</value>
|
||||
</data>
|
||||
<data name="splitContainer1.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="scBig.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Name" xml:space="preserve">
|
||||
<value>splitContainer1</value>
|
||||
<data name=">>scBig.Name" xml:space="preserve">
|
||||
<value>scBig</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Type" xml:space="preserve">
|
||||
<data name=">>scBig.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Parent" xml:space="preserve">
|
||||
<data name=">>scBig.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.ZOrder" xml:space="preserve">
|
||||
<data name=">>scBig.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<metadata name="notifyMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
@@ -813,28 +831,43 @@
|
||||
<value>6, 56</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>203, 22</value>
|
||||
<value>219, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateN.Text" xml:space="preserve">
|
||||
<value>v2rayN (this software)</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>203, 22</value>
|
||||
<value>219, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
|
||||
<value>Update v2flyCore</value>
|
||||
<value>Update v2fly Core</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateXrayCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>203, 22</value>
|
||||
<value>219, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateXrayCore.Text" xml:space="preserve">
|
||||
<value>Update XrayCore</value>
|
||||
<value>Update Xray Core</value>
|
||||
</data>
|
||||
<data name="toolStripSeparator16.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>216, 6</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateClashCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>219, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateClashCore.Text" xml:space="preserve">
|
||||
<value>Update clash Core</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateClashMetaCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>219, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateClashMetaCore.Text" xml:space="preserve">
|
||||
<value>Update Clash.Meta Core</value>
|
||||
</data>
|
||||
<data name="toolStripSeparator15.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>200, 6</value>
|
||||
<value>216, 6</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateGeo.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>203, 22</value>
|
||||
<value>219, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateGeo.Text" xml:space="preserve">
|
||||
<value>Update Geo files</value>
|
||||
@@ -945,7 +978,7 @@
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>90</value>
|
||||
<value>64</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>6, 12</value>
|
||||
@@ -1037,6 +1070,12 @@
|
||||
<data name=">>menuSetDefaultServer.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=">>menuServerFilter.Name" xml:space="preserve">
|
||||
<value>menuServerFilter</value>
|
||||
</data>
|
||||
<data name=">>menuServerFilter.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=">>toolStripSeparator3.Name" xml:space="preserve">
|
||||
<value>toolStripSeparator3</value>
|
||||
</data>
|
||||
@@ -1049,6 +1088,12 @@
|
||||
<data name=">>menuMoveToGroup.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=">>menuMoveEvent.Name" xml:space="preserve">
|
||||
<value>menuMoveEvent</value>
|
||||
</data>
|
||||
<data name=">>menuMoveEvent.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=">>menuMoveTop.Name" xml:space="preserve">
|
||||
<value>menuMoveTop</value>
|
||||
</data>
|
||||
@@ -1109,6 +1154,12 @@
|
||||
<data name=">>menuSpeedServer.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=">>menuSortServerResult.Name" xml:space="preserve">
|
||||
<value>menuSortServerResult</value>
|
||||
</data>
|
||||
<data name=">>menuSortServerResult.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=">>tsbTestMe.Name" xml:space="preserve">
|
||||
<value>tsbTestMe</value>
|
||||
</data>
|
||||
@@ -1367,6 +1418,24 @@
|
||||
<data name=">>tsbCheckUpdateXrayCore.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=">>toolStripSeparator16.Name" xml:space="preserve">
|
||||
<value>toolStripSeparator16</value>
|
||||
</data>
|
||||
<data name=">>toolStripSeparator16.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>tsbCheckUpdateClashCore.Name" xml:space="preserve">
|
||||
<value>tsbCheckUpdateClashCore</value>
|
||||
</data>
|
||||
<data name=">>tsbCheckUpdateClashCore.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=">>tsbCheckUpdateClashMetaCore.Name" xml:space="preserve">
|
||||
<value>tsbCheckUpdateClashMetaCore</value>
|
||||
</data>
|
||||
<data name=">>tsbCheckUpdateClashMetaCore.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=">>toolStripSeparator15.Name" xml:space="preserve">
|
||||
<value>toolStripSeparator15</value>
|
||||
</data>
|
||||
|
||||
@@ -555,4 +555,19 @@
|
||||
<data name="menuMoveToGroup.Text" xml:space="preserve">
|
||||
<value>移至分组</value>
|
||||
</data>
|
||||
<data name="menuMoveEvent.Text" xml:space="preserve">
|
||||
<value>上下移至</value>
|
||||
</data>
|
||||
<data name="menuServerFilter.Text" xml:space="preserve">
|
||||
<value>设置服务器过滤器 (Ctrl+F)</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateClashCore.Text" xml:space="preserve">
|
||||
<value>Update clash Core</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateClashMetaCore.Text" xml:space="preserve">
|
||||
<value>Update Clash.Meta Core</value>
|
||||
</data>
|
||||
<data name="menuSortServerResult.Text" xml:space="preserve">
|
||||
<value>按测试结果排序 (Ctrl+E)</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -16,7 +16,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
public partial class MainMsgControl : UserControl
|
||||
{
|
||||
private string MsgFilter = string.Empty;
|
||||
private string _msgFilter = string.Empty;
|
||||
delegate void AppendTextDelegate(string text);
|
||||
|
||||
public MainMsgControl()
|
||||
@@ -33,15 +33,15 @@ namespace v2rayN.Forms
|
||||
|
||||
public void AppendText(string text)
|
||||
{
|
||||
if (this.txtMsgBox.InvokeRequired)
|
||||
if (txtMsgBox.InvokeRequired)
|
||||
{
|
||||
Invoke(new AppendTextDelegate(AppendText), new object[] { text });
|
||||
Invoke(new AppendTextDelegate(AppendText), text);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Utils.IsNullOrEmpty(MsgFilter))
|
||||
if (!Utils.IsNullOrEmpty(_msgFilter))
|
||||
{
|
||||
if (!Regex.IsMatch(text, MsgFilter))
|
||||
if (!Regex.IsMatch(text, _msgFilter))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -61,10 +61,10 @@ namespace v2rayN.Forms
|
||||
{
|
||||
ClearMsg();
|
||||
}
|
||||
this.txtMsgBox.AppendText(msg);
|
||||
txtMsgBox.AppendText(msg);
|
||||
if (!msg.EndsWith(Environment.NewLine))
|
||||
{
|
||||
this.txtMsgBox.AppendText(Environment.NewLine);
|
||||
txtMsgBox.AppendText(Environment.NewLine);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace v2rayN.Forms
|
||||
|
||||
public void ScrollToCaret()
|
||||
{
|
||||
this.txtMsgBox.ScrollToCaret();
|
||||
txtMsgBox.ScrollToCaret();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -132,24 +132,24 @@ namespace v2rayN.Forms
|
||||
#region MsgBoxMenu
|
||||
private void menuMsgBoxSelectAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.txtMsgBox.Focus();
|
||||
this.txtMsgBox.SelectAll();
|
||||
txtMsgBox.Focus();
|
||||
txtMsgBox.SelectAll();
|
||||
}
|
||||
|
||||
private void menuMsgBoxCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
var data = this.txtMsgBox.SelectedText.TrimEx();
|
||||
var data = txtMsgBox.SelectedText.TrimEx();
|
||||
Utils.SetClipboardData(data);
|
||||
}
|
||||
|
||||
private void menuMsgBoxCopyAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
var data = this.txtMsgBox.Text;
|
||||
var data = txtMsgBox.Text;
|
||||
Utils.SetClipboardData(data);
|
||||
}
|
||||
private void menuMsgBoxClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.txtMsgBox.Clear();
|
||||
txtMsgBox.Clear();
|
||||
}
|
||||
private void menuMsgBoxAddRoutingRule_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -182,11 +182,12 @@ namespace v2rayN.Forms
|
||||
private void menuMsgBoxFilter_Click(object sender, EventArgs e)
|
||||
{
|
||||
var fm = new MsgFilterSetForm();
|
||||
fm.MsgFilter = MsgFilter;
|
||||
fm.MsgFilter = _msgFilter;
|
||||
fm.ShowDefFilter = true;
|
||||
if (fm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
MsgFilter = fm.MsgFilter;
|
||||
gbMsgTitle.Text = string.Format(ResUI.MsgInformationTitle, MsgFilter);
|
||||
_msgFilter = fm.MsgFilter;
|
||||
gbMsgTitle.Text = string.Format(ResUI.MsgInformationTitle, _msgFilter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
39
v2rayN/v2rayN/Forms/MsgFilterSetForm.Designer.cs
generated
39
v2rayN/v2rayN/Forms/MsgFilterSetForm.Designer.cs
generated
@@ -30,12 +30,13 @@
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MsgFilterSetForm));
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.btnFilderProxy = new System.Windows.Forms.Button();
|
||||
this.btnFilterDirect = new System.Windows.Forms.Button();
|
||||
this.txtMsgFilter = new System.Windows.Forms.TextBox();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.btnClose = 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.btnClear = new System.Windows.Forms.Button();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -49,6 +50,20 @@
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
// btnFilderProxy
|
||||
//
|
||||
resources.ApplyResources(this.btnFilderProxy, "btnFilderProxy");
|
||||
this.btnFilderProxy.Name = "btnFilderProxy";
|
||||
this.btnFilderProxy.UseVisualStyleBackColor = true;
|
||||
this.btnFilderProxy.Click += new System.EventHandler(this.btnFilderProxy_Click);
|
||||
//
|
||||
// btnFilterDirect
|
||||
//
|
||||
resources.ApplyResources(this.btnFilterDirect, "btnFilterDirect");
|
||||
this.btnFilterDirect.Name = "btnFilterDirect";
|
||||
this.btnFilterDirect.UseVisualStyleBackColor = true;
|
||||
this.btnFilterDirect.Click += new System.EventHandler(this.btnFilterDirect_Click);
|
||||
//
|
||||
// txtMsgFilter
|
||||
//
|
||||
resources.ApplyResources(this.txtMsgFilter, "txtMsgFilter");
|
||||
@@ -56,6 +71,7 @@
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.btnClear);
|
||||
this.panel2.Controls.Add(this.btnClose);
|
||||
this.panel2.Controls.Add(this.btnOK);
|
||||
resources.ApplyResources(this.panel2, "panel2");
|
||||
@@ -76,24 +92,18 @@
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||
//
|
||||
// btnFilterDirect
|
||||
// btnClear
|
||||
//
|
||||
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);
|
||||
resources.ApplyResources(this.btnClear, "btnClear");
|
||||
this.btnClear.Name = "btnClear";
|
||||
this.btnClear.UseVisualStyleBackColor = true;
|
||||
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
|
||||
//
|
||||
// MsgFilterSetForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnClose;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Name = "MsgFilterSetForm";
|
||||
@@ -114,5 +124,6 @@
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Button btnFilderProxy;
|
||||
private System.Windows.Forms.Button btnFilterDirect;
|
||||
private System.Windows.Forms.Button btnClear;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ namespace v2rayN.Forms
|
||||
public partial class MsgFilterSetForm : BaseForm
|
||||
{
|
||||
public string MsgFilter { get; set; }
|
||||
public bool ShowDefFilter { get; set; }
|
||||
|
||||
public MsgFilterSetForm()
|
||||
{
|
||||
@@ -22,17 +23,19 @@ namespace v2rayN.Forms
|
||||
private void MsgFilterSetForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
txtMsgFilter.Text = MsgFilter;
|
||||
btnFilderProxy.Visible =
|
||||
btnFilterDirect.Visible = ShowDefFilter;
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
MsgFilter = txtMsgFilter.Text;
|
||||
this.DialogResult = DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void btnFilderProxy_Click(object sender, EventArgs e)
|
||||
@@ -44,5 +47,11 @@ namespace v2rayN.Forms
|
||||
{
|
||||
txtMsgFilter.Text = "^(?!.*direct).*$";
|
||||
}
|
||||
|
||||
private void btnClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
MsgFilter = string.Empty;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,14 +117,78 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name=">>btnFilderProxy.Name" xml:space="preserve">
|
||||
<value>btnFilderProxy</value>
|
||||
</data>
|
||||
<data name=">>btnFilderProxy.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=">>btnFilderProxy.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>btnFilderProxy.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>btnFilterDirect.Name" xml:space="preserve">
|
||||
<value>btnFilterDirect</value>
|
||||
</data>
|
||||
<data name=">>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=">>btnFilterDirect.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>btnFilterDirect.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>txtMsgFilter.Name" xml:space="preserve">
|
||||
<value>txtMsgFilter</value>
|
||||
</data>
|
||||
<data name=">>txtMsgFilter.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=">>txtMsgFilter.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>txtMsgFilter.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<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>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>490, 76</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="groupBox1.Text" xml:space="preserve">
|
||||
<value>Filter</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.Name" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>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=">>groupBox1.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="btnFilderProxy.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>157, 47</value>
|
||||
</data>
|
||||
<data name="btnFilderProxy.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>95, 23</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="btnFilderProxy.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>13</value>
|
||||
</data>
|
||||
@@ -143,7 +207,6 @@
|
||||
<data name=">>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>
|
||||
</data>
|
||||
@@ -192,81 +255,33 @@
|
||||
<data name=">>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 name="btnClear.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
<data name="btnClear.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>211, 17</value>
|
||||
</data>
|
||||
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>490, 76</value>
|
||||
<data name="btnClear.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>75, 23</value>
|
||||
</data>
|
||||
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>8</value>
|
||||
<data name="btnClear.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>14</value>
|
||||
</data>
|
||||
<data name="groupBox1.Text" xml:space="preserve">
|
||||
<value>Filter</value>
|
||||
<data name="btnClear.Text" xml:space="preserve">
|
||||
<value>Clear</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.Name" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
<data name=">>btnClear.Name" xml:space="preserve">
|
||||
<value>btnClear</value>
|
||||
</data>
|
||||
<data name=">>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=">>groupBox1.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>groupBox1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>btnClose.Name" xml:space="preserve">
|
||||
<value>btnClose</value>
|
||||
</data>
|
||||
<data name=">>btnClose.Type" xml:space="preserve">
|
||||
<data name=">>btnClear.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=">>btnClose.Parent" xml:space="preserve">
|
||||
<data name=">>btnClear.Parent" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>btnClose.ZOrder" xml:space="preserve">
|
||||
<data name=">>btnClear.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>btnOK.Name" xml:space="preserve">
|
||||
<value>btnOK</value>
|
||||
</data>
|
||||
<data name=">>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=">>btnOK.Parent" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>btnOK.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<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=">>panel2.Name" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>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 name=">>panel2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
@@ -292,7 +307,7 @@
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>btnClose.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
@@ -319,6 +334,30 @@
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>btnOK.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<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=">>panel2.Name" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>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 name=">>panel2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
||||
@@ -135,4 +135,7 @@
|
||||
<data name="btnFilterDirect.Text" xml:space="preserve">
|
||||
<value>过滤Direct</value>
|
||||
</data>
|
||||
<data name="btnClear.Text" xml:space="preserve">
|
||||
<value>清空</value>
|
||||
</data>
|
||||
</root>
|
||||
60
v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs
generated
60
v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs
generated
@@ -68,6 +68,7 @@
|
||||
this.txtKcpmtu = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.tabPage7 = new System.Windows.Forms.TabPage();
|
||||
this.numStatisticsFreshRate = new System.Windows.Forms.NumericUpDown();
|
||||
this.txttrayMenuServersLimit = new System.Windows.Forms.TextBox();
|
||||
this.label17 = new System.Windows.Forms.Label();
|
||||
this.txtautoUpdateSubInterval = new System.Windows.Forms.TextBox();
|
||||
@@ -79,7 +80,6 @@
|
||||
this.label15 = new System.Windows.Forms.Label();
|
||||
this.chkIgnoreGeoUpdateCore = new System.Windows.Forms.CheckBox();
|
||||
this.chkKeepOlderDedupl = new System.Windows.Forms.CheckBox();
|
||||
this.cbFreshrate = new System.Windows.Forms.ComboBox();
|
||||
this.lbFreshrate = new System.Windows.Forms.Label();
|
||||
this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
|
||||
this.chkAutoRun = new System.Windows.Forms.CheckBox();
|
||||
@@ -112,6 +112,7 @@
|
||||
this.tabPage2.SuspendLayout();
|
||||
this.tabPage6.SuspendLayout();
|
||||
this.tabPage7.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numStatisticsFreshRate)).BeginInit();
|
||||
this.tabPageCoreType.SuspendLayout();
|
||||
this.tabPage3.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
@@ -120,33 +121,34 @@
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
resources.ApplyResources(this.btnClose, "btnClose");
|
||||
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// tabControl1
|
||||
//
|
||||
resources.ApplyResources(this.tabControl1, "tabControl1");
|
||||
this.tabControl1.Controls.Add(this.tabPage1);
|
||||
this.tabControl1.Controls.Add(this.tabPage2);
|
||||
this.tabControl1.Controls.Add(this.tabPage6);
|
||||
this.tabControl1.Controls.Add(this.tabPage7);
|
||||
this.tabControl1.Controls.Add(this.tabPageCoreType);
|
||||
this.tabControl1.Controls.Add(this.tabPage3);
|
||||
resources.ApplyResources(this.tabControl1, "tabControl1");
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.groupBox1);
|
||||
resources.ApplyResources(this.tabPage1, "tabPage1");
|
||||
this.tabPage1.Controls.Add(this.groupBox1);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.Controls.Add(this.label16);
|
||||
this.groupBox1.Controls.Add(this.label4);
|
||||
this.groupBox1.Controls.Add(this.txtpass);
|
||||
@@ -163,7 +165,6 @@
|
||||
this.groupBox1.Controls.Add(this.label5);
|
||||
this.groupBox1.Controls.Add(this.txtlocalPort);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
@@ -213,8 +214,8 @@
|
||||
//
|
||||
// cmbprotocol
|
||||
//
|
||||
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
|
||||
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbprotocol.FormattingEnabled = true;
|
||||
this.cmbprotocol.Items.AddRange(new object[] {
|
||||
resources.GetString("cmbprotocol.Items"),
|
||||
@@ -240,6 +241,7 @@
|
||||
//
|
||||
// cmbloglevel
|
||||
//
|
||||
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
|
||||
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbloglevel.FormattingEnabled = true;
|
||||
this.cmbloglevel.Items.AddRange(new object[] {
|
||||
@@ -248,7 +250,6 @@
|
||||
resources.GetString("cmbloglevel.Items2"),
|
||||
resources.GetString("cmbloglevel.Items3"),
|
||||
resources.GetString("cmbloglevel.Items4")});
|
||||
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
|
||||
this.cmbloglevel.Name = "cmbloglevel";
|
||||
//
|
||||
// label5
|
||||
@@ -268,10 +269,10 @@
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
resources.ApplyResources(this.tabPage2, "tabPage2");
|
||||
this.tabPage2.Controls.Add(this.linkDnsObjectDoc);
|
||||
this.tabPage2.Controls.Add(this.txtremoteDNS);
|
||||
this.tabPage2.Controls.Add(this.label14);
|
||||
resources.ApplyResources(this.tabPage2, "tabPage2");
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
@@ -294,6 +295,7 @@
|
||||
//
|
||||
// tabPage6
|
||||
//
|
||||
resources.ApplyResources(this.tabPage6, "tabPage6");
|
||||
this.tabPage6.Controls.Add(this.chkKcpcongestion);
|
||||
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
|
||||
this.tabPage6.Controls.Add(this.label10);
|
||||
@@ -307,7 +309,6 @@
|
||||
this.tabPage6.Controls.Add(this.label7);
|
||||
this.tabPage6.Controls.Add(this.txtKcpmtu);
|
||||
this.tabPage6.Controls.Add(this.label6);
|
||||
resources.ApplyResources(this.tabPage6, "tabPage6");
|
||||
this.tabPage6.Name = "tabPage6";
|
||||
this.tabPage6.UseVisualStyleBackColor = true;
|
||||
//
|
||||
@@ -379,6 +380,8 @@
|
||||
//
|
||||
// tabPage7
|
||||
//
|
||||
resources.ApplyResources(this.tabPage7, "tabPage7");
|
||||
this.tabPage7.Controls.Add(this.numStatisticsFreshRate);
|
||||
this.tabPage7.Controls.Add(this.txttrayMenuServersLimit);
|
||||
this.tabPage7.Controls.Add(this.label17);
|
||||
this.tabPage7.Controls.Add(this.txtautoUpdateSubInterval);
|
||||
@@ -390,14 +393,17 @@
|
||||
this.tabPage7.Controls.Add(this.label15);
|
||||
this.tabPage7.Controls.Add(this.chkIgnoreGeoUpdateCore);
|
||||
this.tabPage7.Controls.Add(this.chkKeepOlderDedupl);
|
||||
this.tabPage7.Controls.Add(this.cbFreshrate);
|
||||
this.tabPage7.Controls.Add(this.lbFreshrate);
|
||||
this.tabPage7.Controls.Add(this.chkEnableStatistics);
|
||||
this.tabPage7.Controls.Add(this.chkAutoRun);
|
||||
resources.ApplyResources(this.tabPage7, "tabPage7");
|
||||
this.tabPage7.Name = "tabPage7";
|
||||
this.tabPage7.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// numStatisticsFreshRate
|
||||
//
|
||||
resources.ApplyResources(this.numStatisticsFreshRate, "numStatisticsFreshRate");
|
||||
this.numStatisticsFreshRate.Name = "numStatisticsFreshRate";
|
||||
//
|
||||
// txttrayMenuServersLimit
|
||||
//
|
||||
resources.ApplyResources(this.txttrayMenuServersLimit, "txttrayMenuServersLimit");
|
||||
@@ -459,13 +465,6 @@
|
||||
this.chkKeepOlderDedupl.Name = "chkKeepOlderDedupl";
|
||||
this.chkKeepOlderDedupl.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbFreshrate
|
||||
//
|
||||
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbFreshrate.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
|
||||
this.cbFreshrate.Name = "cbFreshrate";
|
||||
//
|
||||
// lbFreshrate
|
||||
//
|
||||
resources.ApplyResources(this.lbFreshrate, "lbFreshrate");
|
||||
@@ -485,6 +484,7 @@
|
||||
//
|
||||
// tabPageCoreType
|
||||
//
|
||||
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
|
||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType6);
|
||||
this.tabPageCoreType.Controls.Add(this.labCoreType6);
|
||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType5);
|
||||
@@ -497,15 +497,14 @@
|
||||
this.tabPageCoreType.Controls.Add(this.labCoreType2);
|
||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType1);
|
||||
this.tabPageCoreType.Controls.Add(this.labCoreType1);
|
||||
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
|
||||
this.tabPageCoreType.Name = "tabPageCoreType";
|
||||
this.tabPageCoreType.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cmbCoreType6
|
||||
//
|
||||
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
|
||||
this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType6.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
|
||||
this.cmbCoreType6.Name = "cmbCoreType6";
|
||||
//
|
||||
// labCoreType6
|
||||
@@ -515,9 +514,9 @@
|
||||
//
|
||||
// cmbCoreType5
|
||||
//
|
||||
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
|
||||
this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType5.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
|
||||
this.cmbCoreType5.Name = "cmbCoreType5";
|
||||
//
|
||||
// labCoreType5
|
||||
@@ -527,9 +526,9 @@
|
||||
//
|
||||
// cmbCoreType4
|
||||
//
|
||||
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
|
||||
this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType4.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
|
||||
this.cmbCoreType4.Name = "cmbCoreType4";
|
||||
//
|
||||
// labCoreType4
|
||||
@@ -539,9 +538,9 @@
|
||||
//
|
||||
// cmbCoreType3
|
||||
//
|
||||
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
|
||||
this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType3.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
|
||||
this.cmbCoreType3.Name = "cmbCoreType3";
|
||||
//
|
||||
// labCoreType3
|
||||
@@ -551,9 +550,9 @@
|
||||
//
|
||||
// cmbCoreType2
|
||||
//
|
||||
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
|
||||
this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType2.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
|
||||
this.cmbCoreType2.Name = "cmbCoreType2";
|
||||
//
|
||||
// labCoreType2
|
||||
@@ -563,9 +562,9 @@
|
||||
//
|
||||
// cmbCoreType1
|
||||
//
|
||||
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
|
||||
this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbCoreType1.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
|
||||
this.cmbCoreType1.Name = "cmbCoreType1";
|
||||
//
|
||||
// labCoreType1
|
||||
@@ -575,19 +574,19 @@
|
||||
//
|
||||
// tabPage3
|
||||
//
|
||||
this.tabPage3.Controls.Add(this.groupBox2);
|
||||
resources.ApplyResources(this.tabPage3, "tabPage3");
|
||||
this.tabPage3.Controls.Add(this.groupBox2);
|
||||
this.tabPage3.Name = "tabPage3";
|
||||
this.tabPage3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||
this.groupBox2.Controls.Add(this.label18);
|
||||
this.groupBox2.Controls.Add(this.cmbSystemProxyAdvancedProtocol);
|
||||
this.groupBox2.Controls.Add(this.label13);
|
||||
this.groupBox2.Controls.Add(this.label12);
|
||||
this.groupBox2.Controls.Add(this.txtsystemProxyExceptions);
|
||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.TabStop = false;
|
||||
//
|
||||
@@ -598,8 +597,8 @@
|
||||
//
|
||||
// cmbSystemProxyAdvancedProtocol
|
||||
//
|
||||
this.cmbSystemProxyAdvancedProtocol.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cmbSystemProxyAdvancedProtocol, "cmbSystemProxyAdvancedProtocol");
|
||||
this.cmbSystemProxyAdvancedProtocol.FormattingEnabled = true;
|
||||
this.cmbSystemProxyAdvancedProtocol.Name = "cmbSystemProxyAdvancedProtocol";
|
||||
//
|
||||
// label13
|
||||
@@ -619,9 +618,9 @@
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
resources.ApplyResources(this.panel2, "panel2");
|
||||
this.panel2.Controls.Add(this.btnClose);
|
||||
this.panel2.Controls.Add(this.btnOK);
|
||||
resources.ApplyResources(this.panel2, "panel2");
|
||||
this.panel2.Name = "panel2";
|
||||
//
|
||||
// btnOK
|
||||
@@ -657,6 +656,7 @@
|
||||
this.tabPage6.PerformLayout();
|
||||
this.tabPage7.ResumeLayout(false);
|
||||
this.tabPage7.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numStatisticsFreshRate)).EndInit();
|
||||
this.tabPageCoreType.ResumeLayout(false);
|
||||
this.tabPageCoreType.PerformLayout();
|
||||
this.tabPage3.ResumeLayout(false);
|
||||
@@ -704,7 +704,6 @@
|
||||
private System.Windows.Forms.CheckBox chkAllowLANConn;
|
||||
private System.Windows.Forms.CheckBox chksniffingEnabled;
|
||||
private System.Windows.Forms.CheckBox chkEnableStatistics;
|
||||
private System.Windows.Forms.ComboBox cbFreshrate;
|
||||
private System.Windows.Forms.Label lbFreshrate;
|
||||
private System.Windows.Forms.CheckBox chkKeepOlderDedupl;
|
||||
private System.Windows.Forms.CheckBox chkdefAllowInsecure;
|
||||
@@ -746,5 +745,6 @@
|
||||
private System.Windows.Forms.Label label17;
|
||||
private System.Windows.Forms.ComboBox cmbSystemProxyAdvancedProtocol;
|
||||
private System.Windows.Forms.Label label18;
|
||||
private System.Windows.Forms.NumericUpDown numStatisticsFreshRate;
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ namespace v2rayN.Forms
|
||||
private void OptionSettingForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
cmbSystemProxyAdvancedProtocol.Items.AddRange(Global.IEProxyProtocols.ToArray());
|
||||
|
||||
|
||||
InitBase();
|
||||
|
||||
InitKCP();
|
||||
@@ -88,32 +88,9 @@ namespace v2rayN.Forms
|
||||
chkAutoRun.Checked = Utils.IsAutoRun();
|
||||
|
||||
chkEnableStatistics.Checked = config.enableStatistics;
|
||||
numStatisticsFreshRate.Value = config.statisticsFreshRate;
|
||||
chkKeepOlderDedupl.Checked = config.keepOlderDedupl;
|
||||
|
||||
ComboItem[] cbSource = new ComboItem[]
|
||||
{
|
||||
new ComboItem{ID = (int)Global.StatisticsFreshRate.quick, Text = ResUI.QuickFresh},
|
||||
new ComboItem{ID = (int)Global.StatisticsFreshRate.medium, Text = ResUI.MediumFresh},
|
||||
new ComboItem{ID = (int)Global.StatisticsFreshRate.slow, Text = ResUI.SlowFresh},
|
||||
};
|
||||
cbFreshrate.DataSource = cbSource;
|
||||
|
||||
cbFreshrate.DisplayMember = "Text";
|
||||
cbFreshrate.ValueMember = "ID";
|
||||
|
||||
switch (config.statisticsFreshRate)
|
||||
{
|
||||
case (int)Global.StatisticsFreshRate.quick:
|
||||
cbFreshrate.SelectedItem = cbSource[0];
|
||||
break;
|
||||
case (int)Global.StatisticsFreshRate.medium:
|
||||
cbFreshrate.SelectedItem = cbSource[1];
|
||||
break;
|
||||
case (int)Global.StatisticsFreshRate.slow:
|
||||
cbFreshrate.SelectedItem = cbSource[2];
|
||||
break;
|
||||
}
|
||||
|
||||
chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore;
|
||||
chkEnableAutoAdjustMainLvColWidth.Checked = config.uiItem.enableAutoAdjustMainLvColWidth;
|
||||
chkEnableSecurityProtocolTls13.Checked = config.enableSecurityProtocolTls13;
|
||||
@@ -177,7 +154,7 @@ namespace v2rayN.Forms
|
||||
|
||||
if (ConfigHandler.SaveConfig(ref config) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -309,7 +286,8 @@ namespace v2rayN.Forms
|
||||
|
||||
bool lastEnableStatistics = config.enableStatistics;
|
||||
config.enableStatistics = chkEnableStatistics.Checked;
|
||||
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue;
|
||||
config.statisticsFreshRate = Convert.ToInt32(numStatisticsFreshRate.Value);
|
||||
|
||||
config.keepOlderDedupl = chkKeepOlderDedupl.Checked;
|
||||
|
||||
config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked;
|
||||
@@ -335,7 +313,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -121,123 +121,6 @@
|
||||
<value>取消(&C)</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<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="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">
|
||||
<value>654, 443</value>
|
||||
</data>
|
||||
<data name="tabPage6.Text" xml:space="preserve">
|
||||
<value> Core:KCP设置 </value>
|
||||
</data>
|
||||
<data name="txttrayMenuServersLimit.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>248, 211</value>
|
||||
</data>
|
||||
<data name="label17.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>185, 12</value>
|
||||
</data>
|
||||
<data name="label17.Text" xml:space="preserve">
|
||||
<value>托盘右键菜单服务器展示数量限制</value>
|
||||
</data>
|
||||
<data name="txtautoUpdateSubInterval.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>248, 184</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">
|
||||
<value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value>
|
||||
</data>
|
||||
<data name="chkEnableAutoAdjustMainLvColWidth.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>204, 16</value>
|
||||
</data>
|
||||
<data name="chkEnableAutoAdjustMainLvColWidth.Text" xml:space="preserve">
|
||||
<value>自动调整服务器列宽在更新订阅后</value>
|
||||
</data>
|
||||
<data name="btnSetLoopback.Text" xml:space="preserve">
|
||||
<value>解除Windows10 UWP应用回环代理限制</value>
|
||||
</data>
|
||||
<data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>248, 157</value>
|
||||
</data>
|
||||
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>191, 12</value>
|
||||
</data>
|
||||
<data name="label15.Text" xml:space="preserve">
|
||||
<value>自动更新Geo文件的间隔(单位小时)</value>
|
||||
</data>
|
||||
<data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>150, 16</value>
|
||||
</data>
|
||||
<data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve">
|
||||
<value>更新Core时忽略Geo文件</value>
|
||||
</data>
|
||||
<data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 16</value>
|
||||
</data>
|
||||
<data name="chkKeepOlderDedupl.Text" xml:space="preserve">
|
||||
<value>去重时保留序号较小的项</value>
|
||||
</data>
|
||||
<data name="cbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>431, 37</value>
|
||||
</data>
|
||||
<data name="lbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>339, 41</value>
|
||||
</data>
|
||||
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>77, 12</value>
|
||||
</data>
|
||||
<data name="lbFreshrate.Text" xml:space="preserve">
|
||||
<value>统计刷新频率</value>
|
||||
</data>
|
||||
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>300, 16</value>
|
||||
</data>
|
||||
<data name="chkEnableStatistics.Text" xml:space="preserve">
|
||||
<value>启用统计(实时网速显示和使用流量显示,需要重启)</value>
|
||||
</data>
|
||||
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>180, 16</value>
|
||||
</data>
|
||||
<data name="chkAutoRun.Text" xml:space="preserve">
|
||||
<value>开机自动启动(可能会不成功)</value>
|
||||
</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="tabPageCoreType.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 443</value>
|
||||
</data>
|
||||
<data name="tabPageCoreType.Text" xml:space="preserve">
|
||||
<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="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>662, 469</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>
|
||||
@@ -325,6 +208,15 @@
|
||||
<data name="label2.Text" xml:space="preserve">
|
||||
<value>本地监听端口</value>
|
||||
</data>
|
||||
<data name="groupBox1.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>
|
||||
</data>
|
||||
<data name="tabPage1.Text" xml:space="preserve">
|
||||
<value> Core:基础设置 </value>
|
||||
</data>
|
||||
<data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>161, 12</value>
|
||||
</data>
|
||||
@@ -337,11 +229,110 @@
|
||||
<data name="label14.Text" xml:space="preserve">
|
||||
<value>自定义DNS(可多个,用逗号(,)隔开)</value>
|
||||
</data>
|
||||
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 443</value>
|
||||
</data>
|
||||
<data name="groupBox2.Text" xml:space="preserve">
|
||||
<value>例外</value>
|
||||
<data name="tabPage2.Text" xml:space="preserve">
|
||||
<value> Core:DNS设置 </value>
|
||||
</data>
|
||||
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 443</value>
|
||||
</data>
|
||||
<data name="tabPage6.Text" xml:space="preserve">
|
||||
<value> Core:KCP设置 </value>
|
||||
</data>
|
||||
<data name="numStatisticsFreshRate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>472, 37</value>
|
||||
</data>
|
||||
<data name="txttrayMenuServersLimit.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>248, 211</value>
|
||||
</data>
|
||||
<data name="label17.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>185, 12</value>
|
||||
</data>
|
||||
<data name="label17.Text" xml:space="preserve">
|
||||
<value>托盘右键菜单服务器展示数量限制</value>
|
||||
</data>
|
||||
<data name="txtautoUpdateSubInterval.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>248, 184</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">
|
||||
<value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value>
|
||||
</data>
|
||||
<data name="chkEnableAutoAdjustMainLvColWidth.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>204, 16</value>
|
||||
</data>
|
||||
<data name="chkEnableAutoAdjustMainLvColWidth.Text" xml:space="preserve">
|
||||
<value>自动调整服务器列宽在更新订阅后</value>
|
||||
</data>
|
||||
<data name="btnSetLoopback.Text" xml:space="preserve">
|
||||
<value>解除Windows10 UWP应用回环代理限制</value>
|
||||
</data>
|
||||
<data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>248, 157</value>
|
||||
</data>
|
||||
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>191, 12</value>
|
||||
</data>
|
||||
<data name="label15.Text" xml:space="preserve">
|
||||
<value>自动更新Geo文件的间隔(单位小时)</value>
|
||||
</data>
|
||||
<data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>150, 16</value>
|
||||
</data>
|
||||
<data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve">
|
||||
<value>更新Core时忽略Geo文件</value>
|
||||
</data>
|
||||
<data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 16</value>
|
||||
</data>
|
||||
<data name="chkKeepOlderDedupl.Text" xml:space="preserve">
|
||||
<value>去重时保留序号较小的项</value>
|
||||
</data>
|
||||
<data name="lbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>339, 41</value>
|
||||
</data>
|
||||
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>125, 12</value>
|
||||
</data>
|
||||
<data name="lbFreshrate.Text" xml:space="preserve">
|
||||
<value>统计刷新频率(单位秒)</value>
|
||||
</data>
|
||||
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>300, 16</value>
|
||||
</data>
|
||||
<data name="chkEnableStatistics.Text" xml:space="preserve">
|
||||
<value>启用统计(实时网速显示和使用流量显示,需要重启)</value>
|
||||
</data>
|
||||
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>180, 16</value>
|
||||
</data>
|
||||
<data name="chkAutoRun.Text" xml:space="preserve">
|
||||
<value>开机自动启动(可能会不成功)</value>
|
||||
</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="tabPageCoreType.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>654, 443</value>
|
||||
</data>
|
||||
<data name="tabPageCoreType.Text" xml:space="preserve">
|
||||
<value> Core类型设置 </value>
|
||||
</data>
|
||||
<data name="label18.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>173, 12</value>
|
||||
</data>
|
||||
<data name="label18.Text" xml:space="preserve">
|
||||
<value>高级代理设置, 协议选择(可选)</value>
|
||||
</data>
|
||||
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>95, 12</value>
|
||||
@@ -355,15 +346,30 @@
|
||||
<data name="label12.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 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 name="btnOK.Text" xml:space="preserve">
|
||||
<value>确定(&O)</value>
|
||||
</data>
|
||||
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 479</value>
|
||||
</data>
|
||||
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>662, 60</value>
|
||||
</data>
|
||||
<data name="btnOK.Text" xml:space="preserve">
|
||||
<value>确定(&O)</value>
|
||||
</data>
|
||||
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>662, 10</value>
|
||||
</data>
|
||||
@@ -373,7 +379,4 @@
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>参数设置</value>
|
||||
</data>
|
||||
<data name="label18.Text" xml:space="preserve">
|
||||
<value>高级代理设置, 协议选择(可选)</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -50,6 +50,7 @@
|
||||
this.txtIP = new System.Windows.Forms.TextBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.txtDomain = new System.Windows.Forms.TextBox();
|
||||
this.linkRuleobjectDoc = new System.Windows.Forms.LinkLabel();
|
||||
this.panel3.SuspendLayout();
|
||||
this.panel4.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
@@ -64,6 +65,7 @@
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.linkRuleobjectDoc);
|
||||
this.panel3.Controls.Add(this.chkEnabled);
|
||||
this.panel3.Controls.Add(this.clbInboundTag);
|
||||
this.panel3.Controls.Add(this.label2);
|
||||
@@ -90,7 +92,9 @@
|
||||
this.clbInboundTag.FormattingEnabled = true;
|
||||
this.clbInboundTag.Items.AddRange(new object[] {
|
||||
resources.GetString("clbInboundTag.Items"),
|
||||
resources.GetString("clbInboundTag.Items1")});
|
||||
resources.GetString("clbInboundTag.Items1"),
|
||||
resources.GetString("clbInboundTag.Items2"),
|
||||
resources.GetString("clbInboundTag.Items3")});
|
||||
this.clbInboundTag.MultiColumn = true;
|
||||
this.clbInboundTag.Name = "clbInboundTag";
|
||||
//
|
||||
@@ -208,6 +212,13 @@
|
||||
resources.ApplyResources(this.txtDomain, "txtDomain");
|
||||
this.txtDomain.Name = "txtDomain";
|
||||
//
|
||||
// linkRuleobjectDoc
|
||||
//
|
||||
resources.ApplyResources(this.linkRuleobjectDoc, "linkRuleobjectDoc");
|
||||
this.linkRuleobjectDoc.Name = "linkRuleobjectDoc";
|
||||
this.linkRuleobjectDoc.TabStop = true;
|
||||
this.linkRuleobjectDoc.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkRuleobjectDoc_LinkClicked);
|
||||
//
|
||||
// RoutingRuleSettingDetailsForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
@@ -255,5 +266,6 @@
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.CheckBox chkEnabled;
|
||||
private System.Windows.Forms.CheckBox chkAutoSort;
|
||||
private System.Windows.Forms.LinkLabel linkRuleobjectDoc;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using v2rayN.Base;
|
||||
using v2rayN.Handler;
|
||||
@@ -115,34 +116,33 @@ namespace v2rayN.Forms
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
EndBindingData();
|
||||
var hasRule = false;
|
||||
if (rulesItem.domain != null && rulesItem.domain.Count > 0)
|
||||
{
|
||||
hasRule = true;
|
||||
}
|
||||
if (rulesItem.ip != null && rulesItem.ip.Count > 0)
|
||||
{
|
||||
hasRule = true;
|
||||
}
|
||||
if (rulesItem.protocol != null && rulesItem.protocol.Count > 0)
|
||||
{
|
||||
hasRule = true;
|
||||
}
|
||||
if (!Utils.IsNullOrEmpty(rulesItem.port))
|
||||
{
|
||||
hasRule = true;
|
||||
}
|
||||
|
||||
bool hasRule =
|
||||
rulesItem.domain != null
|
||||
&& rulesItem.domain.Count > 0
|
||||
|| rulesItem.ip != null
|
||||
&& rulesItem.ip.Count > 0
|
||||
|| rulesItem.protocol != null
|
||||
&& rulesItem.protocol.Count > 0
|
||||
|| !Utils.IsNullOrEmpty(rulesItem.port);
|
||||
|
||||
if (!hasRule)
|
||||
{
|
||||
UI.ShowWarning(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Port/Protocol/Domain/IP"));
|
||||
return;
|
||||
}
|
||||
this.DialogResult = DialogResult.OK;
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void linkRuleobjectDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
Process.Start("https://www.v2fly.org/config/routing.html#ruleobject");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,6 +144,39 @@
|
||||
<data name=">>panel1.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="linkRuleobjectDoc.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="linkRuleobjectDoc.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="linkRuleobjectDoc.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>19, 86</value>
|
||||
</data>
|
||||
<data name="linkRuleobjectDoc.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>0, 0, 0, 0</value>
|
||||
</data>
|
||||
<data name="linkRuleobjectDoc.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>89, 12</value>
|
||||
</data>
|
||||
<data name="linkRuleobjectDoc.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>43</value>
|
||||
</data>
|
||||
<data name="linkRuleobjectDoc.Text" xml:space="preserve">
|
||||
<value>Ruleobject Doc</value>
|
||||
</data>
|
||||
<data name=">>linkRuleobjectDoc.Name" xml:space="preserve">
|
||||
<value>linkRuleobjectDoc</value>
|
||||
</data>
|
||||
<data name=">>linkRuleobjectDoc.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>linkRuleobjectDoc.Parent" xml:space="preserve">
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>linkRuleobjectDoc.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="chkEnabled.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
@@ -151,7 +184,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="chkEnabled.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>617, 19</value>
|
||||
<value>632, 45</value>
|
||||
</data>
|
||||
<data name="chkEnabled.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>60, 16</value>
|
||||
@@ -172,7 +205,7 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>chkEnabled.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="clbInboundTag.ColumnWidth" type="System.Int32, mscorlib">
|
||||
<value>80</value>
|
||||
@@ -183,11 +216,17 @@
|
||||
<data name="clbInboundTag.Items1" xml:space="preserve">
|
||||
<value>http</value>
|
||||
</data>
|
||||
<data name="clbInboundTag.Items2" xml:space="preserve">
|
||||
<value>socks2</value>
|
||||
</data>
|
||||
<data name="clbInboundTag.Items3" xml:space="preserve">
|
||||
<value>http2</value>
|
||||
</data>
|
||||
<data name="clbInboundTag.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>347, 16</value>
|
||||
</data>
|
||||
<data name="clbInboundTag.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>245, 20</value>
|
||||
<value>345, 20</value>
|
||||
</data>
|
||||
<data name="clbInboundTag.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>41</value>
|
||||
@@ -202,7 +241,7 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>clbInboundTag.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -232,7 +271,7 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>label2.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="clbProtocol.ColumnWidth" type="System.Int32, mscorlib">
|
||||
<value>80</value>
|
||||
@@ -265,7 +304,7 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>clbProtocol.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -295,7 +334,7 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>label3.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>107, 43</value>
|
||||
@@ -316,7 +355,7 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>txtPort.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -346,16 +385,16 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>label1.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="labRoutingTips.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>19, 82</value>
|
||||
<value>144, 86</value>
|
||||
</data>
|
||||
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>598, 16</value>
|
||||
<value>575, 16</value>
|
||||
</data>
|
||||
<data name="labRoutingTips.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>33</value>
|
||||
@@ -373,7 +412,7 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>labRoutingTips.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -403,7 +442,7 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>label4.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="cmbOutboundTag.Items" xml:space="preserve">
|
||||
<value>proxy</value>
|
||||
@@ -433,7 +472,7 @@
|
||||
<value>panel3</value>
|
||||
</data>
|
||||
<data name=">>cmbOutboundTag.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Top</value>
|
||||
@@ -459,6 +498,66 @@
|
||||
<data name=">>panel3.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name=">>chkAutoSort.Name" xml:space="preserve">
|
||||
<value>chkAutoSort</value>
|
||||
</data>
|
||||
<data name=">>chkAutoSort.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>chkAutoSort.Parent" xml:space="preserve">
|
||||
<value>panel4</value>
|
||||
</data>
|
||||
<data name=">>chkAutoSort.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>btnClose.Name" xml:space="preserve">
|
||||
<value>btnClose</value>
|
||||
</data>
|
||||
<data name=">>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=">>btnClose.Parent" xml:space="preserve">
|
||||
<value>panel4</value>
|
||||
</data>
|
||||
<data name=">>btnClose.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>btnOK.Name" xml:space="preserve">
|
||||
<value>btnOK</value>
|
||||
</data>
|
||||
<data name=">>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=">>btnOK.Parent" xml:space="preserve">
|
||||
<value>panel4</value>
|
||||
</data>
|
||||
<data name=">>btnOK.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Bottom</value>
|
||||
</data>
|
||||
<data name="panel4.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 516</value>
|
||||
</data>
|
||||
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>742, 60</value>
|
||||
</data>
|
||||
<data name="panel4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name=">>panel4.Name" xml:space="preserve">
|
||||
<value>panel4</value>
|
||||
</data>
|
||||
<data name=">>panel4.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>panel4.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>panel4.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="chkAutoSort.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
@@ -543,44 +642,53 @@
|
||||
<data name=">>btnOK.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Bottom</value>
|
||||
<data name=">>groupBox2.Name" xml:space="preserve">
|
||||
<value>groupBox2</value>
|
||||
</data>
|
||||
<data name="panel4.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 516</value>
|
||||
<data name=">>groupBox2.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="panel4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>742, 60</value>
|
||||
<data name=">>groupBox2.Parent" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name="panel4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>10</value>
|
||||
<data name=">>groupBox2.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>panel4.Name" xml:space="preserve">
|
||||
<value>panel4</value>
|
||||
<data name=">>groupBox1.Name" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>panel4.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<data name=">>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=">>panel4.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
<data name=">>groupBox1.Parent" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>panel4.ZOrder" xml:space="preserve">
|
||||
<data name=">>groupBox1.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="txtIP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="txtIP.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>3, 17</value>
|
||||
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 121</value>
|
||||
</data>
|
||||
<data name="txtIP.Multiline" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>742, 395</value>
|
||||
</data>
|
||||
<data name="txtIP.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>344, 375</value>
|
||||
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="txtIP.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>25</value>
|
||||
<data name=">>panel2.Name" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
</data>
|
||||
<data name=">>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 name=">>panel2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>panel2.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>txtIP.Name" xml:space="preserve">
|
||||
<value>txtIP</value>
|
||||
@@ -621,20 +729,32 @@
|
||||
<data name=">>groupBox2.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<data name="txtIP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="txtDomain.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="txtIP.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>3, 17</value>
|
||||
</data>
|
||||
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
|
||||
<data name="txtIP.Multiline" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="txtDomain.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>386, 375</value>
|
||||
<data name="txtIP.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>344, 375</value>
|
||||
</data>
|
||||
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>24</value>
|
||||
<data name="txtIP.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>25</value>
|
||||
</data>
|
||||
<data name=">>txtIP.Name" xml:space="preserve">
|
||||
<value>txtIP</value>
|
||||
</data>
|
||||
<data name=">>txtIP.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=">>txtIP.Parent" xml:space="preserve">
|
||||
<value>groupBox2</value>
|
||||
</data>
|
||||
<data name=">>txtIP.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>txtDomain.Name" xml:space="preserve">
|
||||
<value>txtDomain</value>
|
||||
@@ -675,28 +795,31 @@
|
||||
<data name=">>groupBox1.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 121</value>
|
||||
<data name="txtDomain.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>3, 17</value>
|
||||
</data>
|
||||
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>742, 395</value>
|
||||
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>11</value>
|
||||
<data name="txtDomain.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>386, 375</value>
|
||||
</data>
|
||||
<data name=">>panel2.Name" xml:space="preserve">
|
||||
<value>panel2</value>
|
||||
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>24</value>
|
||||
</data>
|
||||
<data name=">>panel2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<data name=">>txtDomain.Name" xml:space="preserve">
|
||||
<value>txtDomain</value>
|
||||
</data>
|
||||
<data name=">>panel2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
<data name=">>txtDomain.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=">>panel2.ZOrder" xml:space="preserve">
|
||||
<data name=">>txtDomain.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>txtDomain.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
||||
@@ -173,4 +173,7 @@
|
||||
<data name="chkAutoSort.Text" xml:space="preserve">
|
||||
<value>保存时Domain和IP自动排序</value>
|
||||
</data>
|
||||
<data name="linkRuleobjectDoc.Text" xml:space="preserve">
|
||||
<value>规则详细说明文档</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -15,9 +15,9 @@ namespace v2rayN.Forms
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
protected RoutingItem routingItem = null;
|
||||
protected RoutingItem routingItem;
|
||||
|
||||
private List<int> lvSelecteds = new List<int>();
|
||||
private readonly List<int> lvSelecteds = new List<int>();
|
||||
public RoutingRuleSettingForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -25,14 +25,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void RoutingRuleSettingForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (EditIndex >= 0)
|
||||
{
|
||||
routingItem = config.routings[EditIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
routingItem = new RoutingItem();
|
||||
}
|
||||
routingItem = EditIndex >= 0 ? config.routings[EditIndex] : new RoutingItem();
|
||||
if (routingItem.rules == null)
|
||||
{
|
||||
routingItem.rules = new List<RulesItem>();
|
||||
@@ -86,10 +79,8 @@ namespace v2rayN.Forms
|
||||
lvRoutings.BeginUpdate();
|
||||
lvRoutings.Items.Clear();
|
||||
|
||||
for (int k = 0; k < routingItem.rules.Count; k++)
|
||||
foreach (var item in routingItem.rules)
|
||||
{
|
||||
var item = routingItem.rules[k];
|
||||
|
||||
ListViewItem lvItem = new ListViewItem("");
|
||||
Utils.AddSubItem(lvItem, "outboundTag", item.outboundTag);
|
||||
Utils.AddSubItem(lvItem, "port", item.port);
|
||||
@@ -112,7 +103,7 @@ namespace v2rayN.Forms
|
||||
|
||||
if (ConfigHandler.AddRoutingItem(ref config, routingItem, EditIndex) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -122,7 +113,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
private void btnBrowse_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace v2rayN.Forms
|
||||
{
|
||||
public partial class RoutingSettingForm : BaseForm
|
||||
{
|
||||
private List<int> lvSelecteds = new List<int>();
|
||||
private RoutingItem lockedItem;
|
||||
private readonly List<int> _lvSelecteds = new List<int>();
|
||||
private RoutingItem _lockedItem;
|
||||
public RoutingSettingForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -58,7 +58,7 @@ namespace v2rayN.Forms
|
||||
|
||||
if (ConfigHandler.SaveRouting(ref config) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -68,7 +68,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
private void chkenableRoutingAdvanced_CheckedChanged_1(object sender, EventArgs e)
|
||||
{
|
||||
@@ -78,20 +78,20 @@ namespace v2rayN.Forms
|
||||
{
|
||||
if (chkenableRoutingAdvanced.Checked)
|
||||
{
|
||||
this.tabPageProxy.Parent = null;
|
||||
this.tabPageDirect.Parent = null;
|
||||
this.tabPageBlock.Parent = null;
|
||||
this.tabPageRuleList.Parent = tabNormal;
|
||||
tabPageProxy.Parent = null;
|
||||
tabPageDirect.Parent = null;
|
||||
tabPageBlock.Parent = null;
|
||||
tabPageRuleList.Parent = tabNormal;
|
||||
MenuItemBasic.Enabled = false;
|
||||
MenuItemAdvanced.Enabled = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.tabPageProxy.Parent = tabNormal;
|
||||
this.tabPageDirect.Parent = tabNormal;
|
||||
this.tabPageBlock.Parent = tabNormal;
|
||||
this.tabPageRuleList.Parent = null;
|
||||
tabPageProxy.Parent = tabNormal;
|
||||
tabPageDirect.Parent = tabNormal;
|
||||
tabPageBlock.Parent = tabNormal;
|
||||
tabPageRuleList.Parent = null;
|
||||
MenuItemBasic.Enabled = true;
|
||||
MenuItemAdvanced.Enabled = false;
|
||||
}
|
||||
@@ -102,31 +102,31 @@ namespace v2rayN.Forms
|
||||
#region locked
|
||||
private void BindingLockedData()
|
||||
{
|
||||
lockedItem = ConfigHandler.GetLockedRoutingItem(ref config);
|
||||
if (lockedItem != null)
|
||||
_lockedItem = ConfigHandler.GetLockedRoutingItem(ref config);
|
||||
if (_lockedItem != null)
|
||||
{
|
||||
txtProxyDomain.Text = Utils.List2String(lockedItem.rules[0].domain, true);
|
||||
txtProxyIp.Text = Utils.List2String(lockedItem.rules[0].ip, true);
|
||||
txtProxyDomain.Text = Utils.List2String(_lockedItem.rules[0].domain, true);
|
||||
txtProxyIp.Text = Utils.List2String(_lockedItem.rules[0].ip, true);
|
||||
|
||||
txtDirectDomain.Text = Utils.List2String(lockedItem.rules[1].domain, true);
|
||||
txtDirectIp.Text = Utils.List2String(lockedItem.rules[1].ip, true);
|
||||
txtDirectDomain.Text = Utils.List2String(_lockedItem.rules[1].domain, true);
|
||||
txtDirectIp.Text = Utils.List2String(_lockedItem.rules[1].ip, true);
|
||||
|
||||
txtBlockDomain.Text = Utils.List2String(lockedItem.rules[2].domain, true);
|
||||
txtBlockIp.Text = Utils.List2String(lockedItem.rules[2].ip, true);
|
||||
txtBlockDomain.Text = Utils.List2String(_lockedItem.rules[2].domain, true);
|
||||
txtBlockIp.Text = Utils.List2String(_lockedItem.rules[2].ip, true);
|
||||
}
|
||||
}
|
||||
private void EndBindingLockedData()
|
||||
{
|
||||
if (lockedItem != null)
|
||||
if (_lockedItem != null)
|
||||
{
|
||||
lockedItem.rules[0].domain = Utils.String2List(txtProxyDomain.Text.TrimEx());
|
||||
lockedItem.rules[0].ip = Utils.String2List(txtProxyIp.Text.TrimEx());
|
||||
_lockedItem.rules[0].domain = Utils.String2List(txtProxyDomain.Text.TrimEx());
|
||||
_lockedItem.rules[0].ip = Utils.String2List(txtProxyIp.Text.TrimEx());
|
||||
|
||||
lockedItem.rules[1].domain = Utils.String2List(txtDirectDomain.Text.TrimEx());
|
||||
lockedItem.rules[1].ip = Utils.String2List(txtDirectIp.Text.TrimEx());
|
||||
_lockedItem.rules[1].domain = Utils.String2List(txtDirectDomain.Text.TrimEx());
|
||||
_lockedItem.rules[1].ip = Utils.String2List(txtDirectIp.Text.TrimEx());
|
||||
|
||||
lockedItem.rules[2].domain = Utils.String2List(txtBlockDomain.Text.TrimEx());
|
||||
lockedItem.rules[2].ip = Utils.String2List(txtBlockIp.Text.TrimEx());
|
||||
_lockedItem.rules[2].domain = Utils.String2List(txtBlockDomain.Text.TrimEx());
|
||||
_lockedItem.rules[2].ip = Utils.String2List(txtBlockIp.Text.TrimEx());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,7 @@ namespace v2rayN.Forms
|
||||
private int GetLvSelectedIndex()
|
||||
{
|
||||
int index = -1;
|
||||
lvSelecteds.Clear();
|
||||
_lvSelecteds.Clear();
|
||||
try
|
||||
{
|
||||
if (lvRoutings.SelectedIndices.Count <= 0)
|
||||
@@ -219,7 +219,7 @@ namespace v2rayN.Forms
|
||||
index = lvRoutings.SelectedIndices[0];
|
||||
foreach (int i in lvRoutings.SelectedIndices)
|
||||
{
|
||||
lvSelecteds.Add(i);
|
||||
_lvSelecteds.Add(i);
|
||||
}
|
||||
return index;
|
||||
}
|
||||
@@ -264,7 +264,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int k = lvSelecteds.Count - 1; k >= 0; k--)
|
||||
for (int k = _lvSelecteds.Count - 1; k >= 0; k--)
|
||||
{
|
||||
config.routings.RemoveAt(index);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace v2rayN.Forms
|
||||
public partial class ServerTransportControl : UserControl
|
||||
{
|
||||
public bool AllowXtls { get; set; }
|
||||
private VmessItem vmessItem = null;
|
||||
private VmessItem vmessItem;
|
||||
|
||||
public ServerTransportControl()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void SubSettingControl_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Height = grbMain.Height;
|
||||
Height = grbMain.Height;
|
||||
|
||||
groupItem = LazyConfig.Instance.GetConfig().groupItem;
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnShare_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.Height <= grbMain.Height)
|
||||
if (Height <= grbMain.Height)
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(subItem.url))
|
||||
{
|
||||
@@ -98,11 +98,11 @@ namespace v2rayN.Forms
|
||||
return;
|
||||
}
|
||||
picQRCode.Image = QRCodeHelper.GetQRCode(subItem.url);
|
||||
this.Height = grbMain.Height + 200;
|
||||
Height = grbMain.Height + 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Height = grbMain.Height;
|
||||
Height = grbMain.Height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
if (ConfigHandler.SaveSubItem(ref config) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -81,7 +81,7 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace v2rayN
|
||||
public const string clashMetaCoreUrl = "https://github.com/MetaCubeX/Clash.Meta/releases";
|
||||
public const string hysteriaCoreUrl = "https://github.com/HyNetwork/hysteria/releases";
|
||||
public const string naiveproxyCoreUrl = "https://github.com/klzgrad/naiveproxy/releases";
|
||||
public const string geoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
|
||||
|
||||
|
||||
|
||||
@@ -190,12 +191,6 @@ namespace v2rayN
|
||||
/// </summary>
|
||||
public const string CustomIconName = "v2rayN.ico";
|
||||
|
||||
public enum StatisticsFreshRate
|
||||
{
|
||||
quick = 1000,
|
||||
medium = 2000,
|
||||
slow = 3000
|
||||
}
|
||||
public const string StatisticLogOverall = "StatisticLogOverall.json";
|
||||
|
||||
public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*";
|
||||
@@ -211,7 +206,7 @@ namespace v2rayN
|
||||
|
||||
public static readonly List<string> vmessSecuritys = new List<string> { "aes-128-gcm", "chacha20-poly1305", "auto", "none", "zero" };
|
||||
public static readonly List<string> ssSecuritys = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
|
||||
public static readonly List<string> ssSecuritysInXray = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain" };
|
||||
public static readonly List<string> ssSecuritysInXray = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" };
|
||||
public static readonly List<string> xtlsFlows = new List<string> { "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443" };
|
||||
public static readonly List<string> networks = new List<string> { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
|
||||
public static readonly List<string> kcpHeaderTypes = new List<string> { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
|
||||
|
||||
@@ -54,11 +54,9 @@ namespace v2rayN.Handler
|
||||
//Mux
|
||||
muxEnabled = false,
|
||||
|
||||
// 默认不开启统计
|
||||
enableStatistics = false,
|
||||
|
||||
// 默认中等刷新率
|
||||
statisticsFreshRate = (int)Global.StatisticsFreshRate.medium,
|
||||
statisticsFreshRate = 1,
|
||||
|
||||
enableRoutingAdvanced = true
|
||||
};
|
||||
@@ -158,7 +156,10 @@ namespace v2rayN.Handler
|
||||
{
|
||||
config.groupItem = new List<GroupItem>();
|
||||
}
|
||||
|
||||
if (config.statisticsFreshRate > 100)
|
||||
{
|
||||
config.statisticsFreshRate = 1;
|
||||
}
|
||||
|
||||
if (config == null
|
||||
|| config.vmess.Count <= 0
|
||||
@@ -212,18 +213,19 @@ namespace v2rayN.Handler
|
||||
{
|
||||
|
||||
//save temp file
|
||||
var temp = $"{configRes}_temp";
|
||||
if (Utils.ToJsonFile(config, Utils.GetPath(temp)) != 0)
|
||||
var resPath = Utils.GetPath(configRes);
|
||||
var tempPath = $"{resPath}_temp";
|
||||
if (Utils.ToJsonFile(config, tempPath) != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (File.Exists(configRes))
|
||||
if (File.Exists(resPath))
|
||||
{
|
||||
File.Delete(configRes);
|
||||
File.Delete(resPath);
|
||||
}
|
||||
//rename
|
||||
File.Move(temp, configRes);
|
||||
File.Move(tempPath, resPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -244,7 +246,7 @@ namespace v2rayN.Handler
|
||||
/// <returns></returns>
|
||||
public static int AddServer(ref Config config, VmessItem vmessItem, bool toFile = true)
|
||||
{
|
||||
vmessItem.configType = EConfigType.Vmess;
|
||||
vmessItem.configType = EConfigType.VMess;
|
||||
|
||||
vmessItem.address = vmessItem.address.TrimEx();
|
||||
vmessItem.id = vmessItem.id.TrimEx();
|
||||
@@ -303,7 +305,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
VmessItem vmessItem = Utils.DeepCopy(item);
|
||||
vmessItem.indexId = string.Empty;
|
||||
vmessItem.remarks = string.Format("{0}-clone", item.remarks);
|
||||
vmessItem.remarks = $"{item.remarks}-clone";
|
||||
|
||||
if (vmessItem.configType == EConfigType.Custom)
|
||||
{
|
||||
@@ -468,7 +470,7 @@ namespace v2rayN.Handler
|
||||
return -1;
|
||||
}
|
||||
var ext = Path.GetExtension(fileName);
|
||||
string newFileName = string.Format("{0}{1}", Utils.GetGUID(), ext);
|
||||
string newFileName = $"{Utils.GetGUID()}{ext}";
|
||||
//newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
|
||||
|
||||
try
|
||||
@@ -479,8 +481,9 @@ namespace v2rayN.Handler
|
||||
File.Delete(fileName);
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -488,7 +491,7 @@ namespace v2rayN.Handler
|
||||
vmessItem.configType = EConfigType.Custom;
|
||||
if (Utils.IsNullOrEmpty(vmessItem.remarks))
|
||||
{
|
||||
vmessItem.remarks = string.Format("import custom@{0}", DateTime.Now.ToShortDateString());
|
||||
vmessItem.remarks = $"import custom@{DateTime.Now.ToShortDateString()}";
|
||||
}
|
||||
|
||||
|
||||
@@ -608,7 +611,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (vmessItem.configType == EConfigType.Vmess)
|
||||
if (vmessItem.configType == EConfigType.VMess)
|
||||
{
|
||||
string path = "";
|
||||
string host = "";
|
||||
@@ -813,7 +816,7 @@ namespace v2rayN.Handler
|
||||
&& o.path == n.path
|
||||
&& o.streamSecurity == n.streamSecurity
|
||||
&& o.flow == n.flow
|
||||
&& (remarks ? o.remarks == n.remarks : true);
|
||||
&& (!remarks || o.remarks == n.remarks);
|
||||
}
|
||||
|
||||
private static int RemoveVmessItem(Config config, int index)
|
||||
@@ -895,7 +898,7 @@ namespace v2rayN.Handler
|
||||
//groupId
|
||||
vmessItem.groupId = groupId;
|
||||
|
||||
if (vmessItem.configType == EConfigType.Vmess)
|
||||
if (vmessItem.configType == EConfigType.VMess)
|
||||
{
|
||||
if (AddServer(ref config, vmessItem, false) == 0)
|
||||
{
|
||||
@@ -1033,6 +1036,56 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
|
||||
private static int AddBatchServers4SsSIP008(ref Config config, string clipboardData, string subid, List<VmessItem> lstOriSub, string groupId)
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(clipboardData))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!Utils.IsNullOrEmpty(subid))
|
||||
{
|
||||
RemoveServerViaSubid(ref config, subid);
|
||||
}
|
||||
|
||||
//SsSIP008
|
||||
var lstSsServer = Utils.FromJson<List<SsServer>>(clipboardData);
|
||||
if (lstSsServer == null || lstSsServer.Count <= 0)
|
||||
{
|
||||
var ssSIP008 = Utils.FromJson<SsSIP008>(clipboardData);
|
||||
if (ssSIP008?.servers != null && ssSIP008.servers.Count > 0)
|
||||
{
|
||||
lstSsServer = ssSIP008.servers;
|
||||
}
|
||||
}
|
||||
|
||||
if (lstSsServer != null && lstSsServer.Count > 0)
|
||||
{
|
||||
int counter = 0;
|
||||
foreach (var it in lstSsServer)
|
||||
{
|
||||
var ssItem = new VmessItem()
|
||||
{
|
||||
subid = subid,
|
||||
groupId = groupId,
|
||||
remarks = it.remarks,
|
||||
security = it.method,
|
||||
id = it.password,
|
||||
address = it.server,
|
||||
port = Utils.ToInt(it.server_port)
|
||||
};
|
||||
if (AddShadowsocksServer(ref config, ssItem, false) == 0)
|
||||
{
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
ToJsonFile(config);
|
||||
return counter;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static int AddBatchServers(ref Config config, string clipboardData, string subid, string groupId)
|
||||
{
|
||||
List<VmessItem> lstOriSub = null;
|
||||
@@ -1047,6 +1100,11 @@ namespace v2rayN.Handler
|
||||
counter = AddBatchServers(ref config, Utils.Base64Decode(clipboardData), subid, lstOriSub, groupId);
|
||||
}
|
||||
|
||||
if (counter < 1)
|
||||
{
|
||||
counter = AddBatchServers4SsSIP008(ref config, clipboardData, subid, lstOriSub, groupId);
|
||||
}
|
||||
|
||||
//maybe other sub
|
||||
if (counter < 1)
|
||||
{
|
||||
@@ -1098,12 +1156,9 @@ namespace v2rayN.Handler
|
||||
return -1;
|
||||
}
|
||||
|
||||
foreach (SubItem item in config.subItem)
|
||||
foreach (var item in config.subItem.Where(item => Utils.IsNullOrEmpty(item.id)))
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(item.id))
|
||||
{
|
||||
item.id = Utils.GetGUID(false);
|
||||
}
|
||||
item.id = Utils.GetGUID(false);
|
||||
}
|
||||
|
||||
ToJsonFile(config);
|
||||
@@ -1147,12 +1202,9 @@ namespace v2rayN.Handler
|
||||
return -1;
|
||||
}
|
||||
|
||||
foreach (GroupItem item in config.groupItem)
|
||||
foreach (var item in config.groupItem.Where(item => Utils.IsNullOrEmpty(item.id)))
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(item.id))
|
||||
{
|
||||
item.id = Utils.GetGUID(false);
|
||||
}
|
||||
item.id = Utils.GetGUID(false);
|
||||
}
|
||||
|
||||
ToJsonFile(config);
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace v2rayN.Handler
|
||||
|
||||
public ResultEventArgs(bool success, string msg)
|
||||
{
|
||||
this.Success = success;
|
||||
this.Msg = msg;
|
||||
Success = success;
|
||||
Msg = msg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
if (UpdateCompleted != null)
|
||||
{
|
||||
string msg = string.Format("{0} M/s", value).PadLeft(9, ' ');
|
||||
string msg = $"{value} M/s".PadLeft(9, ' ');
|
||||
UpdateCompleted(this, new ResultEventArgs(false, msg));
|
||||
}
|
||||
};
|
||||
@@ -88,7 +88,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
if (UpdateCompleted != null)
|
||||
{
|
||||
string msg = string.Format("...{0}%", value);
|
||||
string msg = $"...{value}%";
|
||||
UpdateCompleted(this, new ResultEventArgs(value > 100 ? true : false, msg));
|
||||
}
|
||||
};
|
||||
@@ -166,6 +166,7 @@ namespace v2rayN.Handler
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
Error?.Invoke(this, new ErrorEventArgs(ex));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -206,7 +207,7 @@ namespace v2rayN.Handler
|
||||
try
|
||||
{
|
||||
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
|
||||
myHttpWebRequest.Timeout = 5000;
|
||||
myHttpWebRequest.Timeout = 30 * 1000;
|
||||
myHttpWebRequest.Proxy = webProxy;
|
||||
|
||||
Stopwatch timer = new Stopwatch();
|
||||
|
||||
@@ -11,10 +11,8 @@ namespace v2rayN.Handler
|
||||
private Config _config;
|
||||
private List<CoreInfo> coreInfos;
|
||||
|
||||
public static LazyConfig Instance
|
||||
{
|
||||
get { return _instance.Value; }
|
||||
}
|
||||
public static LazyConfig Instance => _instance.Value;
|
||||
|
||||
public void SetConfig(ref Config config)
|
||||
{
|
||||
_config = config;
|
||||
@@ -66,12 +64,24 @@ namespace v2rayN.Handler
|
||||
{
|
||||
coreInfos = new List<CoreInfo>();
|
||||
|
||||
coreInfos.Add(new CoreInfo
|
||||
{
|
||||
coreType = ECoreType.v2rayN,
|
||||
coreUrl = Global.NUrl,
|
||||
coreLatestUrl = Global.NUrl + "/latest",
|
||||
coreDownloadUrl32 = Global.NUrl + "/download/{0}/v2rayN.zip",
|
||||
coreDownloadUrl64 = Global.NUrl + "/download/{0}/v2rayN.zip",
|
||||
});
|
||||
|
||||
coreInfos.Add(new CoreInfo
|
||||
{
|
||||
coreType = ECoreType.v2fly,
|
||||
coreExes = new List<string> { "wv2ray", "v2ray" },
|
||||
arguments = "",
|
||||
coreUrl = Global.v2flyCoreUrl,
|
||||
coreLatestUrl = Global.v2flyCoreUrl + "/latest",
|
||||
coreDownloadUrl32 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||
coreDownloadUrl64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||
match = "V2Ray"
|
||||
});
|
||||
|
||||
@@ -81,6 +91,9 @@ namespace v2rayN.Handler
|
||||
coreExes = new List<string> { "xray" },
|
||||
arguments = "",
|
||||
coreUrl = Global.xrayCoreUrl,
|
||||
coreLatestUrl = Global.xrayCoreUrl + "/latest",
|
||||
coreDownloadUrl32 = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip",
|
||||
coreDownloadUrl64 = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip",
|
||||
match = "Xray"
|
||||
});
|
||||
|
||||
@@ -89,7 +102,11 @@ namespace v2rayN.Handler
|
||||
coreType = ECoreType.clash,
|
||||
coreExes = new List<string> { "clash-windows-amd64-v3", "clash-windows-amd64", "clash-windows-386", "clash" },
|
||||
arguments = "-f config.json",
|
||||
coreUrl = Global.clashCoreUrl
|
||||
coreUrl = Global.clashCoreUrl,
|
||||
coreLatestUrl = Global.clashCoreUrl + "/latest",
|
||||
coreDownloadUrl32 = Global.clashCoreUrl + "/download/{0}/clash-windows-386-{0}.zip",
|
||||
coreDownloadUrl64 = Global.clashCoreUrl + "/download/{0}/clash-windows-amd64-{0}.zip",
|
||||
match = "v"
|
||||
});
|
||||
|
||||
coreInfos.Add(new CoreInfo
|
||||
@@ -97,7 +114,10 @@ namespace v2rayN.Handler
|
||||
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
|
||||
coreUrl = Global.clashMetaCoreUrl,
|
||||
coreLatestUrl = Global.clashMetaCoreUrl + "/latest",
|
||||
coreDownloadUrl32 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-386-{0}.zip",
|
||||
coreDownloadUrl64 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-amd64-compatible-{0}.zip",
|
||||
});
|
||||
|
||||
coreInfos.Add(new CoreInfo
|
||||
@@ -105,7 +125,10 @@ namespace v2rayN.Handler
|
||||
coreType = ECoreType.hysteria,
|
||||
coreExes = new List<string> { "hysteria-tun-windows-6.0-amd64", "hysteria-tun-windows-6.0-386", "hysteria" },
|
||||
arguments = "",
|
||||
coreUrl = Global.hysteriaCoreUrl
|
||||
coreUrl = Global.hysteriaCoreUrl,
|
||||
coreLatestUrl = Global.hysteriaCoreUrl + "/latest",
|
||||
coreDownloadUrl32 = Global.hysteriaCoreUrl + "/download/{0}/hysteria-tun-windows-6.0-386.exe",
|
||||
coreDownloadUrl64 = Global.hysteriaCoreUrl + "/download/{0}/hysteria-tun-windows-6.0-amd64.exe",
|
||||
});
|
||||
|
||||
coreInfos.Add(new CoreInfo
|
||||
|
||||
@@ -24,10 +24,8 @@ namespace v2rayN.Handler
|
||||
//private List<int> _selecteds;
|
||||
//private Thread _workThread;
|
||||
//Action<int, string> _updateFunc;
|
||||
public static MainFormHandler Instance
|
||||
{
|
||||
get { return instance.Value; }
|
||||
}
|
||||
public static MainFormHandler Instance => instance.Value;
|
||||
|
||||
public Icon GetNotifyIcon(Config config, Icon def)
|
||||
{
|
||||
try
|
||||
@@ -84,7 +82,7 @@ namespace v2rayN.Handler
|
||||
int index = (int)config.sysProxyType;
|
||||
if (index > 0)
|
||||
{
|
||||
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange, Color.DarkSlateBlue, Color.RoyalBlue })[index - 1];
|
||||
color = (new[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange, Color.DarkSlateBlue, Color.RoyalBlue })[index - 1];
|
||||
}
|
||||
|
||||
int width = 128;
|
||||
@@ -94,8 +92,11 @@ namespace v2rayN.Handler
|
||||
Graphics graphics = Graphics.FromImage(bitmap);
|
||||
SolidBrush drawBrush = new SolidBrush(color);
|
||||
|
||||
graphics.FillRectangle(drawBrush, new Rectangle(0, 0, width, height));
|
||||
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||
//graphics.FillRectangle(drawBrush, new Rectangle(0, 0, width, height));
|
||||
graphics.DrawImage(new Bitmap(item.customIcon), 0, 0, width, height);
|
||||
graphics.FillEllipse(drawBrush, width / 2, width / 2, width / 2, width / 2);
|
||||
|
||||
Icon createdIcon = Icon.FromHandle(bitmap.GetHicon());
|
||||
|
||||
drawBrush.Dispose();
|
||||
@@ -117,8 +118,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (item.configType != EConfigType.Vmess
|
||||
&& item.configType != EConfigType.VLESS)
|
||||
if (item.configType == EConfigType.Custom)
|
||||
{
|
||||
UI.Show(ResUI.NonVmessService);
|
||||
return;
|
||||
@@ -157,7 +157,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (item.configType != EConfigType.Vmess
|
||||
if (item.configType != EConfigType.VMess
|
||||
&& item.configType != EConfigType.VLESS)
|
||||
{
|
||||
UI.Show(ResUI.NonVmessService);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Drawing;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using ZXing;
|
||||
using ZXing.QrCode;
|
||||
|
||||
@@ -34,8 +35,9 @@ namespace v2rayN.Handler
|
||||
img = (Image)bmp;
|
||||
return img;
|
||||
}
|
||||
catch
|
||||
catch(Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
return img;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace v2rayN.Handler
|
||||
|
||||
switch (item.configType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
case EConfigType.VMess:
|
||||
url = ShareVmess(item);
|
||||
break;
|
||||
case EConfigType.Shadowsocks:
|
||||
@@ -51,8 +51,9 @@ namespace v2rayN.Handler
|
||||
}
|
||||
return url;
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -81,7 +82,7 @@ namespace v2rayN.Handler
|
||||
|
||||
url = Utils.ToJson(vmessQRCode);
|
||||
url = Utils.Base64Encode(url);
|
||||
url = string.Format("{0}{1}", Global.vmessProtocol, url);
|
||||
url = $"{Global.vmessProtocol}{url}";
|
||||
|
||||
return url;
|
||||
}
|
||||
@@ -104,7 +105,7 @@ namespace v2rayN.Handler
|
||||
//new Sip002
|
||||
var pw = Utils.Base64Encode($"{item.security}:{item.id}");
|
||||
url = $"{pw}@{GetIpv6(item.address)}:{ item.port}";
|
||||
url = string.Format("{0}{1}{2}", Global.ssProtocol, url, remark);
|
||||
url = $"{Global.ssProtocol}{url}{remark}";
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -125,7 +126,7 @@ namespace v2rayN.Handler
|
||||
//new
|
||||
var pw = Utils.Base64Encode($"{item.security}:{item.id}");
|
||||
url = $"{pw}@{GetIpv6(item.address)}:{ item.port}";
|
||||
url = string.Format("{0}{1}{2}", Global.socksProtocol, url, remark);
|
||||
url = $"{Global.socksProtocol}{url}{remark}";
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -145,7 +146,7 @@ namespace v2rayN.Handler
|
||||
item.id,
|
||||
GetIpv6(item.address),
|
||||
item.port);
|
||||
url = string.Format("{0}{1}{2}{3}", Global.trojanProtocol, url, query, remark);
|
||||
url = $"{Global.trojanProtocol}{url}{query}{remark}";
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -173,7 +174,7 @@ namespace v2rayN.Handler
|
||||
item.id,
|
||||
GetIpv6(item.address),
|
||||
item.port);
|
||||
url = string.Format("{0}{1}{2}{3}", Global.vlessProtocol, url, query, remark);
|
||||
url = $"{Global.vlessProtocol}{url}{query}{remark}";
|
||||
return url;
|
||||
}
|
||||
private static string GetIpv6(string address)
|
||||
@@ -207,40 +208,20 @@ namespace v2rayN.Handler
|
||||
{
|
||||
dicQuery.Add("alpn", Utils.UrlEncode(Utils.List2String(item.alpn)));
|
||||
}
|
||||
if (!Utils.IsNullOrEmpty(item.network))
|
||||
{
|
||||
dicQuery.Add("type", item.network);
|
||||
}
|
||||
else
|
||||
{
|
||||
dicQuery.Add("type", "tcp");
|
||||
}
|
||||
|
||||
dicQuery.Add("type", !Utils.IsNullOrEmpty(item.network) ? item.network : "tcp");
|
||||
|
||||
switch (item.network)
|
||||
{
|
||||
case "tcp":
|
||||
if (!Utils.IsNullOrEmpty(item.headerType))
|
||||
{
|
||||
dicQuery.Add("headerType", item.headerType);
|
||||
}
|
||||
else
|
||||
{
|
||||
dicQuery.Add("headerType", "none");
|
||||
}
|
||||
dicQuery.Add("headerType", !Utils.IsNullOrEmpty(item.headerType) ? item.headerType : "none");
|
||||
if (!Utils.IsNullOrEmpty(item.requestHost))
|
||||
{
|
||||
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
|
||||
}
|
||||
break;
|
||||
case "kcp":
|
||||
if (!Utils.IsNullOrEmpty(item.headerType))
|
||||
{
|
||||
dicQuery.Add("headerType", item.headerType);
|
||||
}
|
||||
else
|
||||
{
|
||||
dicQuery.Add("headerType", "none");
|
||||
}
|
||||
dicQuery.Add("headerType", !Utils.IsNullOrEmpty(item.headerType) ? item.headerType : "none");
|
||||
if (!Utils.IsNullOrEmpty(item.path))
|
||||
{
|
||||
dicQuery.Add("seed", Utils.UrlEncode(item.path));
|
||||
@@ -272,14 +253,7 @@ namespace v2rayN.Handler
|
||||
break;
|
||||
|
||||
case "quic":
|
||||
if (!Utils.IsNullOrEmpty(item.headerType))
|
||||
{
|
||||
dicQuery.Add("headerType", item.headerType);
|
||||
}
|
||||
else
|
||||
{
|
||||
dicQuery.Add("headerType", "none");
|
||||
}
|
||||
dicQuery.Add("headerType", !Utils.IsNullOrEmpty(item.headerType) ? item.headerType : "none");
|
||||
dicQuery.Add("quicSecurity", Utils.UrlEncode(item.requestHost));
|
||||
dicQuery.Add("key", Utils.UrlEncode(item.path));
|
||||
break;
|
||||
@@ -341,11 +315,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
msg = ResUI.ConfigurationFormatIncorrect;
|
||||
|
||||
vmessItem = ResolveSSLegacy(result);
|
||||
if (vmessItem == null)
|
||||
{
|
||||
vmessItem = ResolveSip002(result);
|
||||
}
|
||||
vmessItem = ResolveSSLegacy(result) ?? ResolveSip002(result);
|
||||
if (vmessItem == null)
|
||||
{
|
||||
return null;
|
||||
@@ -361,11 +331,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
msg = ResUI.ConfigurationFormatIncorrect;
|
||||
|
||||
vmessItem = ResolveSocksNew(result);
|
||||
if (vmessItem == null)
|
||||
{
|
||||
vmessItem = ResolveSocks(result);
|
||||
}
|
||||
vmessItem = ResolveSocksNew(result) ?? ResolveSocks(result);
|
||||
if (vmessItem == null)
|
||||
{
|
||||
return null;
|
||||
@@ -395,8 +361,9 @@ namespace v2rayN.Handler
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
msg = ResUI.Incorrectconfiguration;
|
||||
return null;
|
||||
}
|
||||
@@ -407,9 +374,11 @@ namespace v2rayN.Handler
|
||||
private static VmessItem ResolveVmess(string result, out string msg)
|
||||
{
|
||||
msg = string.Empty;
|
||||
VmessItem vmessItem = new VmessItem();
|
||||
var vmessItem = new VmessItem
|
||||
{
|
||||
configType = EConfigType.VMess
|
||||
};
|
||||
|
||||
vmessItem.configType = EConfigType.Vmess;
|
||||
result = result.Substring(Global.vmessProtocol.Length);
|
||||
result = Utils.Base64Decode(result);
|
||||
|
||||
@@ -432,14 +401,7 @@ namespace v2rayN.Handler
|
||||
vmessItem.alterId = Utils.ToInt(vmessQRCode.aid);
|
||||
vmessItem.security = Utils.ToString(vmessQRCode.scy);
|
||||
|
||||
if (!Utils.IsNullOrEmpty(vmessQRCode.scy))
|
||||
{
|
||||
vmessItem.security = vmessQRCode.scy;
|
||||
}
|
||||
else
|
||||
{
|
||||
vmessItem.security = Global.DefaultSecurity;
|
||||
}
|
||||
vmessItem.security = !Utils.IsNullOrEmpty(vmessQRCode.scy) ? vmessQRCode.scy : Global.DefaultSecurity;
|
||||
if (!Utils.IsNullOrEmpty(vmessQRCode.net))
|
||||
{
|
||||
vmessItem.network = vmessQRCode.net;
|
||||
@@ -462,7 +424,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
VmessItem vmessItem = new VmessItem
|
||||
{
|
||||
configType = EConfigType.Vmess
|
||||
configType = EConfigType.VMess
|
||||
};
|
||||
result = result.Substring(Global.vmessProtocol.Length);
|
||||
int indexSplit = result.IndexOf("?");
|
||||
@@ -500,7 +462,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
VmessItem i = new VmessItem
|
||||
{
|
||||
configType = EConfigType.Vmess,
|
||||
configType = EConfigType.VMess,
|
||||
security = "auto"
|
||||
};
|
||||
|
||||
@@ -594,22 +556,47 @@ namespace v2rayN.Handler
|
||||
address = parsedUrl.IdnHost,
|
||||
port = parsedUrl.Port,
|
||||
};
|
||||
|
||||
// parse base64 UserInfo
|
||||
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.UriEscaped);
|
||||
string userInfo = Utils.Base64Decode(rawUserInfo);
|
||||
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2);
|
||||
if (userInfoParts.Length != 2)
|
||||
//2022-blake3
|
||||
if (rawUserInfo.Contains(":"))
|
||||
{
|
||||
return null;
|
||||
string[] userInfoParts = rawUserInfo.Split(new[] { ':' }, 2);
|
||||
if (userInfoParts.Length != 2)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
server.security = userInfoParts[0];
|
||||
server.id = Utils.UrlDecode(userInfoParts[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// parse base64 UserInfo
|
||||
string userInfo = Utils.Base64Decode(rawUserInfo);
|
||||
string[] userInfoParts = userInfo.Split(new[] { ':' }, 2);
|
||||
if (userInfoParts.Length != 2)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
server.security = userInfoParts[0];
|
||||
server.id = userInfoParts[1];
|
||||
}
|
||||
server.security = userInfoParts[0];
|
||||
server.id = userInfoParts[1];
|
||||
|
||||
NameValueCollection queryParameters = HttpUtility.ParseQueryString(parsedUrl.Query);
|
||||
if (queryParameters["plugin"] != null)
|
||||
{
|
||||
return null;
|
||||
//obfs-host exists
|
||||
var obfsHost = queryParameters["plugin"].Split(';').FirstOrDefault(t => t.Contains("obfs-host"));
|
||||
if (queryParameters["plugin"].Contains("obfs=http") && !Utils.IsNullOrEmpty(obfsHost))
|
||||
{
|
||||
obfsHost = obfsHost.Replace("obfs-host=", "");
|
||||
server.network = Global.DefaultNetwork;
|
||||
server.headerType = Global.TcpHeaderHttp;
|
||||
server.requestHost = obfsHost;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return server;
|
||||
@@ -655,8 +642,10 @@ namespace v2rayN.Handler
|
||||
|
||||
private static VmessItem ResolveSocks(string result)
|
||||
{
|
||||
VmessItem vmessItem = new VmessItem();
|
||||
vmessItem.configType = EConfigType.Socks;
|
||||
VmessItem vmessItem = new VmessItem
|
||||
{
|
||||
configType = EConfigType.Socks
|
||||
};
|
||||
result = result.Substring(Global.socksProtocol.Length);
|
||||
//remark
|
||||
int indexRemark = result.IndexOf("#");
|
||||
@@ -720,7 +709,7 @@ namespace v2rayN.Handler
|
||||
// parse base64 UserInfo
|
||||
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.Unescaped);
|
||||
string userInfo = Utils.Base64Decode(rawUserInfo);
|
||||
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2);
|
||||
string[] userInfoParts = userInfo.Split(new[] { ':' }, 2);
|
||||
if (userInfoParts.Length == 2)
|
||||
{
|
||||
server.security = userInfoParts[0];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
@@ -43,19 +44,19 @@ namespace v2rayN.Handler
|
||||
|
||||
if (actionType == ESpeedActionType.Ping)
|
||||
{
|
||||
Task.Run(() => RunPing());
|
||||
Task.Run(RunPing);
|
||||
}
|
||||
else if (actionType == ESpeedActionType.Tcping)
|
||||
{
|
||||
Task.Run(() => RunTcping());
|
||||
Task.Run(RunTcping);
|
||||
}
|
||||
else if (actionType == ESpeedActionType.Realping)
|
||||
{
|
||||
Task.Run(() => RunRealPing());
|
||||
Task.Run(RunRealPing);
|
||||
}
|
||||
else if (actionType == ESpeedActionType.Speedtest)
|
||||
{
|
||||
Task.Run(() => RunSpeedTestAsync());
|
||||
Task.Run(RunSpeedTestAsync);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,12 +64,8 @@ namespace v2rayN.Handler
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var it in _selecteds)
|
||||
foreach (var it in _selecteds.Where(it => it.configType != EConfigType.Custom))
|
||||
{
|
||||
if (it.configType == EConfigType.Custom)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
Task.Run(() => updateFun(it));
|
||||
@@ -252,7 +249,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
return "Timeout";
|
||||
}
|
||||
return string.Format("{0}{1}", time, unit).PadLeft(8, ' ');
|
||||
return $"{time}{unit}".PadLeft(8, ' ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,13 +31,7 @@ namespace v2rayN.Handler
|
||||
}
|
||||
|
||||
|
||||
public List<ServerStatItem> Statistic
|
||||
{
|
||||
get
|
||||
{
|
||||
return serverStatistics_.server;
|
||||
}
|
||||
}
|
||||
public List<ServerStatItem> Statistic => serverStatistics_.server;
|
||||
|
||||
public StatisticsHandler(Mode.Config config, Action<ulong, ulong, List<ServerStatItem>> update)
|
||||
{
|
||||
@@ -68,7 +62,7 @@ namespace v2rayN.Handler
|
||||
|
||||
GrpcInit();
|
||||
|
||||
Task.Run(() => Run());
|
||||
Task.Run(Run);
|
||||
}
|
||||
|
||||
private void GrpcInit()
|
||||
@@ -133,7 +127,7 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
}
|
||||
Thread.Sleep(config_.statisticsFreshRate);
|
||||
Thread.Sleep(1000 * config_.statisticsFreshRate);
|
||||
channel_.ConnectAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -26,19 +26,11 @@ namespace v2rayN.Handler
|
||||
|
||||
public ResultEventArgs(bool success, string msg)
|
||||
{
|
||||
this.Success = success;
|
||||
this.Msg = msg;
|
||||
Success = success;
|
||||
Msg = msg;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly string nLatestUrl = Global.NUrl + "/latest";
|
||||
private const string nUrl = Global.NUrl + "/download/{0}/v2rayN.zip";
|
||||
private readonly string v2flyCoreLatestUrl = Global.v2flyCoreUrl + "/latest";
|
||||
private const string v2flyCoreUrl = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip";
|
||||
private readonly string xrayCoreLatestUrl = Global.xrayCoreUrl + "/latest";
|
||||
private const string xrayCoreUrl = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip";
|
||||
private const string geoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
|
||||
|
||||
public void CheckUpdateGuiN(Config config, Action<bool, string> update)
|
||||
{
|
||||
_config = config;
|
||||
@@ -206,27 +198,38 @@ namespace v2rayN.Handler
|
||||
continue;
|
||||
}
|
||||
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgStartGettingSubscriptions}");
|
||||
var result = await (new DownloadHandle()).DownloadStringAsync(url, blProxy, userAgent);
|
||||
var downloadHandle = new DownloadHandle();
|
||||
downloadHandle.Error += (sender2, args) =>
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{args.GetException().Message}");
|
||||
};
|
||||
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgStartGettingSubscriptions}");
|
||||
var result = await downloadHandle.DownloadStringAsync(url, blProxy, userAgent);
|
||||
if (blProxy && Utils.IsNullOrEmpty(result))
|
||||
{
|
||||
result = await downloadHandle.DownloadStringAsync(url, false, userAgent);
|
||||
}
|
||||
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgGetSubscriptionSuccessfully}");
|
||||
if (Utils.IsNullOrEmpty(result))
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgSubscriptionDecodingFailed}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgGetSubscriptionSuccessfully}");
|
||||
if (result.Length < 99)
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{result}");
|
||||
}
|
||||
|
||||
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,
|
||||
ret > 0
|
||||
? $"{hashCode}{ResUI.MsgUpdateSubscriptionEnd}"
|
||||
: $"{hashCode}{ResUI.MsgFailedImportSubscription}");
|
||||
}
|
||||
_updateFunc(false, $"-------------------------------------------------------");
|
||||
_updateFunc(false, "-------------------------------------------------------");
|
||||
}
|
||||
//restore system proxy
|
||||
if (bSysProxyType)
|
||||
@@ -244,7 +247,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
_config = config;
|
||||
_updateFunc = update;
|
||||
var url = string.Format(geoUrl, geoName);
|
||||
var url = string.Format(Global.geoUrl, geoName);
|
||||
|
||||
DownloadHandle downloadHandle = null;
|
||||
if (downloadHandle == null)
|
||||
@@ -306,23 +309,8 @@ namespace v2rayN.Handler
|
||||
{
|
||||
try
|
||||
{
|
||||
string url;
|
||||
if (type == ECoreType.v2fly)
|
||||
{
|
||||
url = v2flyCoreLatestUrl;
|
||||
}
|
||||
else if (type == ECoreType.Xray)
|
||||
{
|
||||
url = xrayCoreLatestUrl;
|
||||
}
|
||||
else if (type == ECoreType.v2rayN)
|
||||
{
|
||||
url = nLatestUrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Type");
|
||||
}
|
||||
var coreInfo = LazyConfig.Instance.GetCoreInfo(type);
|
||||
string url = coreInfo.coreLatestUrl;
|
||||
|
||||
var result = await (new DownloadHandle()).UrlRedirectAsync(url, true);
|
||||
if (!Utils.IsNullOrEmpty(result))
|
||||
@@ -354,7 +342,7 @@ namespace v2rayN.Handler
|
||||
string filePath = string.Empty;
|
||||
foreach (string name in coreInfo.coreExes)
|
||||
{
|
||||
string vName = string.Format("{0}.exe", name);
|
||||
string vName = $"{name}.exe";
|
||||
vName = Utils.GetPath(vName);
|
||||
if (File.Exists(vName))
|
||||
{
|
||||
@@ -396,33 +384,46 @@ namespace v2rayN.Handler
|
||||
try
|
||||
{
|
||||
string version = redirectUrl.Substring(redirectUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);
|
||||
var coreInfo = LazyConfig.Instance.GetCoreInfo(type);
|
||||
|
||||
string curVersion;
|
||||
string message;
|
||||
string url;
|
||||
if (type == ECoreType.v2fly)
|
||||
switch (type)
|
||||
{
|
||||
curVersion = "v" + getCoreVersion(type);
|
||||
message = string.Format(ResUI.IsLatestCore, curVersion);
|
||||
string osBit = Environment.Is64BitProcess ? "64" : "32";
|
||||
url = string.Format(v2flyCoreUrl, version, osBit);
|
||||
}
|
||||
else if (type == ECoreType.Xray)
|
||||
{
|
||||
curVersion = "v" + getCoreVersion(type);
|
||||
message = string.Format(ResUI.IsLatestCore, curVersion);
|
||||
string osBit = Environment.Is64BitProcess ? "64" : "32";
|
||||
url = string.Format(xrayCoreUrl, version, osBit);
|
||||
}
|
||||
else if (type == ECoreType.v2rayN)
|
||||
{
|
||||
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
|
||||
message = string.Format(ResUI.IsLatestN, curVersion);
|
||||
url = string.Format(nUrl, version);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Type");
|
||||
case ECoreType.v2fly:
|
||||
case ECoreType.Xray:
|
||||
{
|
||||
curVersion = "v" + getCoreVersion(type);
|
||||
message = string.Format(ResUI.IsLatestCore, curVersion);
|
||||
string osBit = Environment.Is64BitProcess ? "64" : "32";
|
||||
url = string.Format(coreInfo.coreDownloadUrl64, version, osBit);
|
||||
break;
|
||||
}
|
||||
case ECoreType.clash:
|
||||
case ECoreType.clash_meta:
|
||||
{
|
||||
curVersion = "";//getCoreVersion(type);
|
||||
message = string.Format(ResUI.IsLatestCore, curVersion);
|
||||
if (Environment.Is64BitProcess)
|
||||
{
|
||||
url = string.Format(coreInfo.coreDownloadUrl64, version);
|
||||
}
|
||||
else
|
||||
{
|
||||
url = string.Format(coreInfo.coreDownloadUrl32, version);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ECoreType.v2rayN:
|
||||
{
|
||||
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
|
||||
message = string.Format(ResUI.IsLatestN, curVersion);
|
||||
url = string.Format(coreInfo.coreDownloadUrl64, version);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new ArgumentException("Type");
|
||||
}
|
||||
|
||||
if (curVersion == version)
|
||||
|
||||
@@ -83,8 +83,9 @@ namespace v2rayN.Handler
|
||||
|
||||
msg = string.Format(ResUI.SuccessfulConfiguration, $"[{config.GetGroupRemarks(node.groupId)}] {node.GetSummary()}");
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog("GenerateClientConfig", ex);
|
||||
msg = ResUI.FailedGenDefaultConfiguration;
|
||||
return -1;
|
||||
}
|
||||
@@ -130,8 +131,9 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -176,8 +178,9 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -246,8 +249,9 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -345,8 +349,9 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -363,7 +368,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
var config = LazyConfig.Instance.GetConfig();
|
||||
Outbounds outbound = v2rayConfig.outbounds[0];
|
||||
if (node.configType == EConfigType.Vmess)
|
||||
if (node.configType == EConfigType.VMess)
|
||||
{
|
||||
VnextItem vnextItem;
|
||||
if (outbound.settings.vnext.Count <= 0)
|
||||
@@ -406,9 +411,7 @@ namespace v2rayN.Handler
|
||||
outbound.mux.enabled = config.muxEnabled;
|
||||
outbound.mux.concurrency = config.muxEnabled ? 8 : -1;
|
||||
|
||||
//远程服务器底层传输配置
|
||||
StreamSettings streamSettings = outbound.streamSettings;
|
||||
boundStreamSettings(node, "out", ref streamSettings);
|
||||
boundStreamSettings(node, "out", outbound.streamSettings);
|
||||
|
||||
outbound.protocol = Global.vmessProtocolLite;
|
||||
outbound.settings.servers = null;
|
||||
@@ -429,14 +432,7 @@ namespace v2rayN.Handler
|
||||
serversItem.address = node.address;
|
||||
serversItem.port = node.port;
|
||||
serversItem.password = node.id;
|
||||
if (LazyConfig.Instance.GetShadowsocksSecuritys().Contains(node.security))
|
||||
{
|
||||
serversItem.method = node.security;
|
||||
}
|
||||
else
|
||||
{
|
||||
serversItem.method = "none";
|
||||
}
|
||||
serversItem.method = LazyConfig.Instance.GetShadowsocksSecuritys().Contains(node.security) ? node.security : "none";
|
||||
|
||||
|
||||
serversItem.ota = false;
|
||||
@@ -445,6 +441,7 @@ namespace v2rayN.Handler
|
||||
outbound.mux.enabled = false;
|
||||
outbound.mux.concurrency = -1;
|
||||
|
||||
boundStreamSettings(node, "out", outbound.streamSettings);
|
||||
|
||||
outbound.protocol = Global.ssProtocolLite;
|
||||
outbound.settings.vnext = null;
|
||||
@@ -522,9 +519,7 @@ namespace v2rayN.Handler
|
||||
outbound.mux.enabled = config.muxEnabled;
|
||||
outbound.mux.concurrency = config.muxEnabled ? 8 : -1;
|
||||
|
||||
//远程服务器底层传输配置
|
||||
StreamSettings streamSettings = outbound.streamSettings;
|
||||
boundStreamSettings(node, "out", ref streamSettings);
|
||||
boundStreamSettings(node, "out", outbound.streamSettings);
|
||||
|
||||
//if xtls
|
||||
if (node.streamSecurity == Global.StreamSecurityX)
|
||||
@@ -585,34 +580,32 @@ namespace v2rayN.Handler
|
||||
outbound.mux.enabled = false;
|
||||
outbound.mux.concurrency = -1;
|
||||
|
||||
|
||||
//远程服务器底层传输配置
|
||||
StreamSettings streamSettings = outbound.streamSettings;
|
||||
boundStreamSettings(node, "out", ref streamSettings);
|
||||
boundStreamSettings(node, "out", outbound.streamSettings);
|
||||
|
||||
outbound.protocol = Global.trojanProtocolLite;
|
||||
outbound.settings.vnext = null;
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// vmess协议远程服务器底层传输配置
|
||||
/// 底层传输配置
|
||||
/// </summary>
|
||||
/// <param name="node"></param>
|
||||
/// <param name="iobound"></param>
|
||||
/// <param name="streamSettings"></param>
|
||||
/// <returns></returns>
|
||||
private static int boundStreamSettings(VmessItem node, string iobound, ref StreamSettings streamSettings)
|
||||
private static int boundStreamSettings(VmessItem node, string iobound, StreamSettings streamSettings)
|
||||
{
|
||||
try
|
||||
{
|
||||
var config = LazyConfig.Instance.GetConfig();
|
||||
//远程服务器底层传输配置
|
||||
|
||||
streamSettings.network = node.GetNetwork();
|
||||
string host = node.requestHost.TrimEx();
|
||||
string sni = node.sni;
|
||||
@@ -767,10 +760,12 @@ namespace v2rayN.Handler
|
||||
}
|
||||
break;
|
||||
case "grpc":
|
||||
var grpcSettings = new GrpcSettings();
|
||||
var grpcSettings = new GrpcSettings
|
||||
{
|
||||
serviceName = node.path,
|
||||
multiMode = (node.headerType == Global.GrpcmultiMode)
|
||||
};
|
||||
|
||||
grpcSettings.serviceName = node.path;
|
||||
grpcSettings.multiMode = (node.headerType == Global.GrpcmultiMode ? true : false);
|
||||
streamSettings.grpcSettings = grpcSettings;
|
||||
break;
|
||||
default:
|
||||
@@ -791,7 +786,7 @@ namespace v2rayN.Handler
|
||||
string request = Utils.GetEmbedText(Global.v2raySampleHttprequestFileName);
|
||||
string[] arrHost = host.Split(',');
|
||||
string host2 = string.Join("\",\"", arrHost);
|
||||
request = request.Replace("$requestHost$", string.Format("\"{0}\"", host2));
|
||||
request = request.Replace("$requestHost$", $"\"{host2}\"");
|
||||
//request = request.Replace("$requestHost$", string.Format("\"{0}\"", config.requestHost()));
|
||||
|
||||
//填入自定义Path
|
||||
@@ -801,7 +796,7 @@ namespace v2rayN.Handler
|
||||
string[] arrPath = node.path.Split(',');
|
||||
pathHttp = string.Join("\",\"", arrPath);
|
||||
}
|
||||
request = request.Replace("$requestPath$", string.Format("\"{0}\"", pathHttp));
|
||||
request = request.Replace("$requestPath$", $"\"{pathHttp}\"");
|
||||
tcpSettings.header.request = Utils.FromJson<object>(request);
|
||||
}
|
||||
else if (iobound.Equals("in"))
|
||||
@@ -815,8 +810,9 @@ namespace v2rayN.Handler
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -860,8 +856,9 @@ namespace v2rayN.Handler
|
||||
};
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -888,7 +885,7 @@ namespace v2rayN.Handler
|
||||
policyObj.system = policySystemSetting;
|
||||
v2rayConfig.policy = policyObj;
|
||||
|
||||
if (!v2rayConfig.inbounds.Exists(item => { return item.tag == tag; }))
|
||||
if (!v2rayConfig.inbounds.Exists(item => item.tag == tag))
|
||||
{
|
||||
Inbounds apiInbound = new Inbounds();
|
||||
Inboundsettings apiInboundSettings = new Inboundsettings();
|
||||
@@ -901,7 +898,7 @@ namespace v2rayN.Handler
|
||||
v2rayConfig.inbounds.Add(apiInbound);
|
||||
}
|
||||
|
||||
if (!v2rayConfig.routing.rules.Exists(item => { return item.outboundTag == tag; }))
|
||||
if (!v2rayConfig.routing.rules.Exists(item => item.outboundTag == tag))
|
||||
{
|
||||
RulesItem apiRoutingRule = new RulesItem
|
||||
{
|
||||
@@ -967,6 +964,18 @@ namespace v2rayN.Handler
|
||||
break;
|
||||
case ECoreType.clash:
|
||||
case ECoreType.clash_meta:
|
||||
//remove the original
|
||||
var indexPort = fileContent.FindIndex(t => t.Contains("port:"));
|
||||
if (indexPort >= 0)
|
||||
{
|
||||
fileContent.RemoveAt(indexPort);
|
||||
}
|
||||
indexPort = fileContent.FindIndex(t => t.Contains("socks-port:"));
|
||||
if (indexPort >= 0)
|
||||
{
|
||||
fileContent.RemoveAt(indexPort);
|
||||
}
|
||||
|
||||
fileContent.Add($"port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundHttp)}");
|
||||
fileContent.Add($"socks-port: {LazyConfig.Instance.GetConfig().GetLocalPort(Global.InboundSocks)}");
|
||||
break;
|
||||
@@ -1039,8 +1048,9 @@ namespace v2rayN.Handler
|
||||
|
||||
msg = string.Format(ResUI.SuccessfulConfiguration, node.GetSummary());
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
msg = ResUI.FailedGenDefaultConfiguration;
|
||||
return -1;
|
||||
}
|
||||
@@ -1075,7 +1085,7 @@ namespace v2rayN.Handler
|
||||
usersItem.id = node.id;
|
||||
usersItem.email = Global.userEMail;
|
||||
|
||||
if (node.configType == EConfigType.Vmess)
|
||||
if (node.configType == EConfigType.VMess)
|
||||
{
|
||||
inbound.protocol = Global.vmessProtocolLite;
|
||||
usersItem.alterId = node.alterId;
|
||||
@@ -1088,12 +1098,11 @@ namespace v2rayN.Handler
|
||||
inbound.settings.decryption = node.security;
|
||||
}
|
||||
|
||||
//远程服务器底层传输配置
|
||||
StreamSettings streamSettings = inbound.streamSettings;
|
||||
boundStreamSettings(node, "in", ref streamSettings);
|
||||
boundStreamSettings(node, "in", inbound.streamSettings);
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1113,8 +1122,9 @@ namespace v2rayN.Handler
|
||||
v2rayConfig.outbounds[0].settings = null;
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1179,7 +1189,7 @@ namespace v2rayN.Handler
|
||||
vmessItem.port = outbound.settings.vnext[0].port;
|
||||
vmessItem.id = outbound.settings.vnext[0].users[0].id;
|
||||
vmessItem.alterId = outbound.settings.vnext[0].users[0].alterId;
|
||||
vmessItem.remarks = string.Format("import@{0}", DateTime.Now.ToShortDateString());
|
||||
vmessItem.remarks = $"import@{DateTime.Now.ToShortDateString()}";
|
||||
|
||||
//tcp or kcp
|
||||
if (outbound.streamSettings != null
|
||||
@@ -1259,8 +1269,9 @@ namespace v2rayN.Handler
|
||||
vmessItem.streamSecurity = Global.StreamSecurity;
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
msg = ResUI.IncorrectClientConfiguration;
|
||||
return null;
|
||||
}
|
||||
@@ -1324,7 +1335,7 @@ namespace v2rayN.Handler
|
||||
vmessItem.id = inbound.settings.clients[0].id;
|
||||
vmessItem.alterId = inbound.settings.clients[0].alterId;
|
||||
|
||||
vmessItem.remarks = string.Format("import@{0}", DateTime.Now.ToShortDateString());
|
||||
vmessItem.remarks = $"import@{DateTime.Now.ToShortDateString()}";
|
||||
|
||||
//tcp or kcp
|
||||
if (inbound.streamSettings != null
|
||||
@@ -1404,8 +1415,9 @@ namespace v2rayN.Handler
|
||||
vmessItem.streamSecurity = Global.StreamSecurity;
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
msg = ResUI.IncorrectClientConfiguration;
|
||||
return null;
|
||||
}
|
||||
@@ -1473,7 +1485,10 @@ namespace v2rayN.Handler
|
||||
{
|
||||
lstIpEndPoints = new List<IPEndPoint>(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners());
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
|
||||
log(configCopy, ref v2rayConfig, false);
|
||||
//routing(config, ref v2rayConfig);
|
||||
@@ -1493,7 +1508,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (it.configType == EConfigType.Vmess || it.configType == EConfigType.VLESS)
|
||||
if (it.configType == EConfigType.VMess || it.configType == EConfigType.VLESS)
|
||||
{
|
||||
if (!Utils.IsGuidByParse(configCopy.GetVmessItem(it.indexId).id))
|
||||
{
|
||||
@@ -1549,8 +1564,9 @@ namespace v2rayN.Handler
|
||||
//msg = string.Format(ResUI.SuccessfulConfiguration"), node.getSummary());
|
||||
return Utils.ToJson(v2rayConfig);
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
msg = ResUI.FailedGenDefaultConfiguration;
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace v2rayN.Handler
|
||||
string fileName = string.Empty;
|
||||
foreach (string name in lstCoreTemp)
|
||||
{
|
||||
string vName = string.Format("{0}.exe", name);
|
||||
string vName = $"{name}.exe";
|
||||
vName = Utils.GetPath(vName);
|
||||
if (File.Exists(vName))
|
||||
{
|
||||
@@ -217,14 +217,14 @@ namespace v2rayN.Handler
|
||||
StandardOutputEncoding = Encoding.UTF8
|
||||
}
|
||||
};
|
||||
p.OutputDataReceived += new DataReceivedEventHandler((sender, e) =>
|
||||
p.OutputDataReceived += (sender, e) =>
|
||||
{
|
||||
if (!String.IsNullOrEmpty(e.Data))
|
||||
{
|
||||
string msg = e.Data + Environment.NewLine;
|
||||
ShowMsg(false, msg);
|
||||
}
|
||||
});
|
||||
};
|
||||
p.Start();
|
||||
p.PriorityClass = ProcessPriorityClass.High;
|
||||
p.BeginOutputReadLine();
|
||||
@@ -254,7 +254,7 @@ namespace v2rayN.Handler
|
||||
|
||||
try
|
||||
{
|
||||
string fileName = V2rayFindexe(new List<string> { "xray" });
|
||||
string fileName = V2rayFindexe(new List<string> { "xray", "wv2ray", "v2ray" });
|
||||
if (fileName == "") return -1;
|
||||
|
||||
Process p = new Process
|
||||
@@ -272,14 +272,14 @@ namespace v2rayN.Handler
|
||||
StandardOutputEncoding = Encoding.UTF8
|
||||
}
|
||||
};
|
||||
p.OutputDataReceived += new DataReceivedEventHandler((sender, e) =>
|
||||
p.OutputDataReceived += (sender, e) =>
|
||||
{
|
||||
if (!String.IsNullOrEmpty(e.Data))
|
||||
{
|
||||
string msg = e.Data + Environment.NewLine;
|
||||
ShowMsg(false, msg);
|
||||
}
|
||||
});
|
||||
};
|
||||
p.Start();
|
||||
p.BeginOutputReadLine();
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ namespace v2rayN.Mode
|
||||
public VmessItem()
|
||||
{
|
||||
indexId = string.Empty;
|
||||
configType = EConfigType.Vmess;
|
||||
configType = EConfigType.VMess;
|
||||
configVersion = 2;
|
||||
sort = 0;
|
||||
address = string.Empty;
|
||||
@@ -323,7 +323,7 @@ namespace v2rayN.Mode
|
||||
}
|
||||
switch (configType)
|
||||
{
|
||||
case EConfigType.Vmess:
|
||||
case EConfigType.VMess:
|
||||
case EConfigType.Shadowsocks:
|
||||
case EConfigType.Socks:
|
||||
case EConfigType.VLESS:
|
||||
|
||||
@@ -14,6 +14,12 @@ namespace v2rayN.Mode
|
||||
|
||||
public string coreUrl { get; set; }
|
||||
|
||||
public string coreLatestUrl { get; set; }
|
||||
|
||||
public string coreDownloadUrl32 { get; set; }
|
||||
|
||||
public string coreDownloadUrl64 { get; set; }
|
||||
|
||||
public string match { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace v2rayN.Mode
|
||||
{
|
||||
public enum EConfigType
|
||||
{
|
||||
Vmess = 1,
|
||||
VMess = 1,
|
||||
Custom = 2,
|
||||
Shadowsocks = 3,
|
||||
Socks = 4,
|
||||
|
||||
22
v2rayN/v2rayN/Mode/SsSIP008.cs
Normal file
22
v2rayN/v2rayN/Mode/SsSIP008.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace v2rayN.Mode
|
||||
{
|
||||
public class SsSIP008
|
||||
{
|
||||
public List<SsServer> servers { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class SsServer
|
||||
{
|
||||
public string remarks { get; set; }
|
||||
public string server { get; set; }
|
||||
public string server_port { get; set; }
|
||||
public string method { get; set; }
|
||||
public string password { get; set; }
|
||||
public string plugin { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +1,13 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using v2rayN.Forms;
|
||||
using v2rayN.Properties;
|
||||
using v2rayN.Tool;
|
||||
|
||||
namespace v2rayN
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
||||
private static extern bool SetProcessDPIAware();
|
||||
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
@@ -21,12 +16,12 @@ namespace v2rayN
|
||||
{
|
||||
if (Environment.OSVersion.Version.Major >= 6)
|
||||
{
|
||||
SetProcessDPIAware();
|
||||
Utils.SetProcessDPIAware();
|
||||
}
|
||||
|
||||
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
|
||||
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
|
||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||
Application.ThreadException += Application_ThreadException;
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
|
||||
|
||||
//AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
|
||||
@@ -47,6 +42,22 @@ namespace v2rayN
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
//read handle from reg and show the window
|
||||
long.TryParse(Utils.RegReadValue(Global.MyRegPath, Utils.WindowHwndKey, ""), out long llong);
|
||||
if (llong > 0)
|
||||
{
|
||||
var hwnd = (IntPtr)llong;
|
||||
if (Utils.IsWindow(hwnd))
|
||||
{
|
||||
Utils.ShowWindow(hwnd, 4);
|
||||
Utils.SwitchToThisWindow(hwnd, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
UI.ShowWarning($"v2rayN is already running(v2rayN已经运行)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
|
||||
// 方法是按如下所示使用“*”:
|
||||
//[assembly: AssemblyVersion("1.0.*")]
|
||||
//[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("5.22")]
|
||||
[assembly: AssemblyFileVersion("5.28")]
|
||||
|
||||
43
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
43
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
@@ -106,7 +106,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 configuration format is incorrect 的本地化字符串。
|
||||
/// 查找类似 Invalid configuration format 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string ConfigurationFormatIncorrect {
|
||||
get {
|
||||
@@ -133,7 +133,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 DOWN 的本地化字符串。
|
||||
/// 查找类似 Download 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string downloadSpeed {
|
||||
get {
|
||||
@@ -439,7 +439,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Today download traffic 的本地化字符串。
|
||||
/// 查找类似 Download traffic today 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string LvTodayDownloadDataAmount {
|
||||
get {
|
||||
@@ -448,7 +448,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Today upload traffic 的本地化字符串。
|
||||
/// 查找类似 Upload traffic today 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string LvTodayUploadDataAmount {
|
||||
get {
|
||||
@@ -493,7 +493,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 MediumFresh 的本地化字符串。
|
||||
/// 查找类似 Medium 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string MediumFresh {
|
||||
get {
|
||||
@@ -538,7 +538,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Get the subscription content successfully 的本地化字符串。
|
||||
/// 查找类似 Get subscription content successfully 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string MsgGetSubscriptionSuccessfully {
|
||||
get {
|
||||
@@ -547,7 +547,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Informations (Filter : {0}) 的本地化字符串。
|
||||
/// 查找类似 Information (Filter : {0}) 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string MsgInformationTitle {
|
||||
get {
|
||||
@@ -600,6 +600,15 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Servers (Filter : {0}) 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string MsgServerTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("MsgServerTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Simplify PAC Success 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -700,7 +709,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Non-vmess or ss protocol 的本地化字符串。
|
||||
/// 查找类似 Non-VMess or ss protocol 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string NonvmessOrssProtocol {
|
||||
get {
|
||||
@@ -709,7 +718,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 non-Vmess service, this feature is invalid 的本地化字符串。
|
||||
/// 查找类似 non-standard service, this feature is invalid 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string NonVmessService {
|
||||
get {
|
||||
@@ -736,7 +745,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 operation failed, please check retry 的本地化字符串。
|
||||
/// 查找类似 operation failed, please check and retry 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string OperationFailed {
|
||||
get {
|
||||
@@ -772,7 +781,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Please select an agreement 的本地化字符串。
|
||||
/// 查找类似 Please select a protocol 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string PleaseSelectProtocol {
|
||||
get {
|
||||
@@ -799,7 +808,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 QuickFresh 的本地化字符串。
|
||||
/// 查找类似 Fast 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string QuickFresh {
|
||||
get {
|
||||
@@ -880,7 +889,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 SlowFresh 的本地化字符串。
|
||||
/// 查找类似 Slow 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string SlowFresh {
|
||||
get {
|
||||
@@ -889,7 +898,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node! 的本地化字符串。
|
||||
/// 查找类似 Note: This feature relies on the Http global proxy. Please manually adjust the Http global proxy and active node after testing. 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string SpeedServerTips {
|
||||
get {
|
||||
@@ -907,7 +916,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 PAC failed to start. Run it with Admin right. 的本地化字符串。
|
||||
/// 查找类似 PAC failed to start. Please run this program as Administrator. 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string StartPacFailed {
|
||||
get {
|
||||
@@ -925,7 +934,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Successful configuration
|
||||
/// 查找类似 Configuration successful
|
||||
///{0} 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string SuccessfulConfiguration {
|
||||
@@ -935,7 +944,7 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Successfully imported custom configuration server 的本地化字符串。
|
||||
/// 查找类似 Custom configuration server imported successfully. 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string SuccessfullyImportedCustomServer {
|
||||
get {
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<value>Please check the server settings first</value>
|
||||
</data>
|
||||
<data name="ConfigurationFormatIncorrect" xml:space="preserve">
|
||||
<value> configuration format is incorrect</value>
|
||||
<value>Invalid configuration format</value>
|
||||
</data>
|
||||
<data name="CustomServerTips" xml:space="preserve">
|
||||
<value>Note that custom configuration relies entirely on your own configuration and does not work with all settings. If you want to use the system proxy, please modify the listening port manually.</value>
|
||||
@@ -136,7 +136,7 @@
|
||||
<value>Downloading...</value>
|
||||
</data>
|
||||
<data name="downloadSpeed" xml:space="preserve">
|
||||
<value>DOWN</value>
|
||||
<value>Download</value>
|
||||
</data>
|
||||
<data name="DownloadYesNo" xml:space="preserve">
|
||||
<value>Whether to download? {0}</value>
|
||||
@@ -214,10 +214,10 @@
|
||||
<value>Test Results</value>
|
||||
</data>
|
||||
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
|
||||
<value>Today download traffic</value>
|
||||
<value>Download traffic today</value>
|
||||
</data>
|
||||
<data name="LvTodayUploadDataAmount" xml:space="preserve">
|
||||
<value>Today upload traffic</value>
|
||||
<value>Upload traffic today</value>
|
||||
</data>
|
||||
<data name="LvTotalDownloadDataAmount" xml:space="preserve">
|
||||
<value>Total download traffic</value>
|
||||
@@ -229,7 +229,7 @@
|
||||
<value>Transport</value>
|
||||
</data>
|
||||
<data name="MediumFresh" xml:space="preserve">
|
||||
<value>MediumFresh</value>
|
||||
<value>Medium</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>Clear original subscription content</value>
|
||||
@@ -241,7 +241,7 @@
|
||||
<value>Failed to import subscription content</value>
|
||||
</data>
|
||||
<data name="MsgGetSubscriptionSuccessfully" xml:space="preserve">
|
||||
<value>Get the subscription content successfully</value>
|
||||
<value>Get subscription content successfully</value>
|
||||
</data>
|
||||
<data name="MsgNoValidSubscription" xml:space="preserve">
|
||||
<value>No valid subscriptions set</value>
|
||||
@@ -289,10 +289,10 @@
|
||||
<value> This feature relies on the Http global proxy, please set it correctly first.</value>
|
||||
</data>
|
||||
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
||||
<value>Non-vmess or ss protocol</value>
|
||||
<value>Non-VMess or ss protocol</value>
|
||||
</data>
|
||||
<data name="NonVmessService" xml:space="preserve">
|
||||
<value> non-Vmess service, this feature is invalid</value>
|
||||
<value> non-standard service, this feature is invalid</value>
|
||||
</data>
|
||||
<data name="NotFoundCore" xml:space="preserve">
|
||||
<value>Core not found, please download: {0}</value>
|
||||
@@ -301,7 +301,7 @@
|
||||
<value>Scan completed, no valid QR code found</value>
|
||||
</data>
|
||||
<data name="OperationFailed" xml:space="preserve">
|
||||
<value> operation failed, please check retry</value>
|
||||
<value> operation failed, please check and retry</value>
|
||||
</data>
|
||||
<data name="PleaseFillRemarks" xml:space="preserve">
|
||||
<value>Please Fill Remarks</value>
|
||||
@@ -310,13 +310,13 @@
|
||||
<value>Please select the encryption method</value>
|
||||
</data>
|
||||
<data name="PleaseSelectProtocol" xml:space="preserve">
|
||||
<value>Please select an agreement</value>
|
||||
<value>Please select a protocol</value>
|
||||
</data>
|
||||
<data name="PleaseSelectServer" xml:space="preserve">
|
||||
<value>Please select the server first</value>
|
||||
</data>
|
||||
<data name="QuickFresh" xml:space="preserve">
|
||||
<value>QuickFresh</value>
|
||||
<value>Fast</value>
|
||||
</data>
|
||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||
<value>Servers deduplication completed. Old: {0}, New: {1}.</value>
|
||||
@@ -331,23 +331,23 @@
|
||||
<value>The server configuration file is saved at: {0}</value>
|
||||
</data>
|
||||
<data name="SlowFresh" xml:space="preserve">
|
||||
<value>SlowFresh</value>
|
||||
<value>Slow</value>
|
||||
</data>
|
||||
<data name="SpeedServerTips" xml:space="preserve">
|
||||
<value>Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node!</value>
|
||||
<value>Note: This feature relies on the Http global proxy. Please manually adjust the Http global proxy and active node after testing.</value>
|
||||
</data>
|
||||
<data name="StartPacFailed" xml:space="preserve">
|
||||
<value>PAC failed to start. Run it with Admin right.</value>
|
||||
<value>PAC failed to start. Please run this program as Administrator.</value>
|
||||
</data>
|
||||
<data name="StartService" xml:space="preserve">
|
||||
<value>Start service ({0})...</value>
|
||||
</data>
|
||||
<data name="SuccessfulConfiguration" xml:space="preserve">
|
||||
<value>Successful configuration
|
||||
<value>Configuration successful
|
||||
{0}</value>
|
||||
</data>
|
||||
<data name="SuccessfullyImportedCustomServer" xml:space="preserve">
|
||||
<value>Successfully imported custom configuration server</value>
|
||||
<value>Custom configuration server imported successfully.</value>
|
||||
</data>
|
||||
<data name="SuccessfullyImportedServerViaClipboard" xml:space="preserve">
|
||||
<value>{0} servers have been imported from clipboard.</value>
|
||||
@@ -389,7 +389,7 @@
|
||||
<value>Download GeoFile: {0} successfully</value>
|
||||
</data>
|
||||
<data name="MsgInformationTitle" xml:space="preserve">
|
||||
<value>Informations (Filter : {0})</value>
|
||||
<value>Information (Filter : {0})</value>
|
||||
</data>
|
||||
<data name="LvCustomIcon" xml:space="preserve">
|
||||
<value>Custom Icon</value>
|
||||
@@ -469,4 +469,7 @@
|
||||
<data name="LabLocal" xml:space="preserve">
|
||||
<value>Local</value>
|
||||
</data>
|
||||
<data name="MsgServerTitle" xml:space="preserve">
|
||||
<value>Servers (Filter : {0})</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -289,10 +289,10 @@
|
||||
<value>此功能依赖Http全局代理,请先设置正确。</value>
|
||||
</data>
|
||||
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
||||
<value>非vmess或ss协议</value>
|
||||
<value>非VMess或ss协议</value>
|
||||
</data>
|
||||
<data name="NonVmessService" xml:space="preserve">
|
||||
<value>非Vmess服务,此功能无效</value>
|
||||
<value>非标准服务,此功能无效</value>
|
||||
</data>
|
||||
<data name="NotFoundCore" xml:space="preserve">
|
||||
<value>找不到Core,下载地址: {0}</value>
|
||||
@@ -469,4 +469,7 @@
|
||||
<data name="LabLocal" xml:space="preserve">
|
||||
<value>本地</value>
|
||||
</data>
|
||||
<data name="MsgServerTitle" xml:space="preserve">
|
||||
<value>服务器 (过滤器 : {0})</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -13,23 +13,27 @@ namespace v2rayN.Tool
|
||||
{
|
||||
public static void Setup()
|
||||
{
|
||||
Hierarchy hierarchy = (Hierarchy)LogManager.GetRepository();
|
||||
var hierarchy = (Hierarchy)LogManager.GetRepository();
|
||||
|
||||
PatternLayout patternLayout = new PatternLayout();
|
||||
patternLayout.ConversionPattern = "%date [%thread] %-5level %logger - %message%newline";
|
||||
var patternLayout = new PatternLayout
|
||||
{
|
||||
ConversionPattern = "%date [%thread] %-5level %logger - %message%newline"
|
||||
};
|
||||
patternLayout.ActivateOptions();
|
||||
|
||||
RollingFileAppender roller = new RollingFileAppender();
|
||||
roller.AppendToFile = true;
|
||||
roller.RollingStyle = RollingFileAppender.RollingMode.Date;
|
||||
roller.DatePattern = "yyyy-MM-dd'.txt'";
|
||||
roller.File = Utils.GetPath(@"guiLogs\");
|
||||
roller.Layout = patternLayout;
|
||||
roller.StaticLogFileName = false;
|
||||
var roller = new RollingFileAppender
|
||||
{
|
||||
AppendToFile = true,
|
||||
RollingStyle = RollingFileAppender.RollingMode.Date,
|
||||
DatePattern = "yyyy-MM-dd'.txt'",
|
||||
File = Utils.GetPath(@"guiLogs\"),
|
||||
Layout = patternLayout,
|
||||
StaticLogFileName = false
|
||||
};
|
||||
roller.ActivateOptions();
|
||||
hierarchy.Root.AddAppender(roller);
|
||||
|
||||
MemoryAppender memory = new MemoryAppender();
|
||||
var memory = new MemoryAppender();
|
||||
memory.ActivateOptions();
|
||||
hierarchy.Root.AddAppender(memory);
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ using Newtonsoft.Json.Linq;
|
||||
using System.Web;
|
||||
using log4net;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace v2rayN
|
||||
{
|
||||
@@ -397,6 +399,20 @@ namespace v2rayN
|
||||
{
|
||||
return HttpUtility.UrlDecode(url);
|
||||
}
|
||||
|
||||
public static string GetMD5(string str)
|
||||
{
|
||||
var md5 = MD5.Create();
|
||||
byte[] byteOld = Encoding.UTF8.GetBytes(str);
|
||||
byte[] byteNew = md5.ComputeHash(byteOld);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (byte b in byteNew)
|
||||
{
|
||||
sb.Append(b.ToString("x2"));
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -529,7 +545,13 @@ namespace v2rayN
|
||||
|
||||
#region 开机自动启动
|
||||
|
||||
private static string autoRunName = "v2rayNAutoRun";
|
||||
private static string autoRunName
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"v2rayNAutoRun_{GetMD5(StartupPath())}";
|
||||
}
|
||||
}
|
||||
private static string autoRunRegPath
|
||||
{
|
||||
get
|
||||
@@ -930,7 +952,7 @@ namespace v2rayN
|
||||
|
||||
public static string GetDownloadFileName(string url)
|
||||
{
|
||||
var fileName = System.IO.Path.GetFileName(url);
|
||||
var fileName = Path.GetFileName(url);
|
||||
fileName += "_temp";
|
||||
|
||||
return fileName;
|
||||
@@ -961,7 +983,7 @@ namespace v2rayN
|
||||
// return path to store temporary files
|
||||
public static string GetTempPath(string filename = "")
|
||||
{
|
||||
string _tempPath = Path.Combine(StartupPath(), "v2ray_win_temp");
|
||||
string _tempPath = Path.Combine(StartupPath(), "guiTemps");
|
||||
if (!Directory.Exists(_tempPath))
|
||||
{
|
||||
Directory.CreateDirectory(_tempPath);
|
||||
@@ -1090,5 +1112,30 @@ namespace v2rayN
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Windows API
|
||||
|
||||
public static string WindowHwndKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"WindowHwnd_{GetMD5(StartupPath())}";
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool SetProcessDPIAware();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int SwitchToThisWindow(IntPtr hwnd, bool fUnknown);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool IsWindow(IntPtr hwnd);
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,6 +216,7 @@
|
||||
<Compile Include="Mode\SysproxyConfig.cs" />
|
||||
<Compile Include="Mode\EConfigType.cs" />
|
||||
<Compile Include="Mode\ServerTestItem.cs" />
|
||||
<Compile Include="Mode\SsSIP008.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
@@ -306,6 +307,7 @@
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\OptionSettingForm.zh-Hans.resx">
|
||||
<DependentUpon>OptionSettingForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\QRCodeControl.zh-Hans.resx">
|
||||
<DependentUpon>QRCodeControl.cs</DependentUpon>
|
||||
@@ -488,13 +490,13 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf">
|
||||
<Version>3.20.0</Version>
|
||||
<Version>3.21.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Grpc.Core">
|
||||
<Version>2.45.0</Version>
|
||||
<Version>2.46.3</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Grpc.Tools">
|
||||
<Version>2.45.0</Version>
|
||||
<Version>2.46.3</Version>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
||||
Reference in New Issue
Block a user