pull/1232/head 4.2
2dust 2020-12-30 15:55:37 +08:00
parent 03c4954c27
commit 9dc8cba3f0
45 changed files with 3278 additions and 9942 deletions

View File

@ -46,5 +46,7 @@ namespace v2rayN.Base
}
catch { }
}
}
}

View File

@ -1318,7 +1318,7 @@
<value>True</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
<value>114</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>

View File

@ -68,9 +68,9 @@
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuGlobal = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepClear = new System.Windows.Forms.ToolStripMenuItem();
this.menuGlobal = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuServers = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddServers2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuScanScreen2 = new System.Windows.Forms.ToolStripMenuItem();
@ -421,16 +421,16 @@
//
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuKeepNothing,
this.menuKeepClear,
this.menuGlobal,
this.menuKeepClear});
this.menuKeepNothing});
this.menuSysAgentMode.Name = "menuSysAgentMode";
//
// menuKeepNothing
// menuKeepClear
//
resources.ApplyResources(this.menuKeepNothing, "menuKeepNothing");
this.menuKeepNothing.Name = "menuKeepNothing";
this.menuKeepNothing.Click += new System.EventHandler(this.menuKeepNothing_Click);
resources.ApplyResources(this.menuKeepClear, "menuKeepClear");
this.menuKeepClear.Name = "menuKeepClear";
this.menuKeepClear.Click += new System.EventHandler(this.menuKeepClear_Click);
//
// menuGlobal
//
@ -438,11 +438,11 @@
this.menuGlobal.Name = "menuGlobal";
this.menuGlobal.Click += new System.EventHandler(this.menuGlobal_Click);
//
// menuKeepClear
// menuKeepNothing
//
resources.ApplyResources(this.menuKeepClear, "menuKeepClear");
this.menuKeepClear.Name = "menuKeepClear";
this.menuKeepClear.Click += new System.EventHandler(this.menuKeepClear_Click);
resources.ApplyResources(this.menuKeepNothing, "menuKeepNothing");
this.menuKeepNothing.Name = "menuKeepNothing";
this.menuKeepNothing.Click += new System.EventHandler(this.menuKeepNothing_Click);
//
// menuServers
//

View File

@ -223,11 +223,7 @@ namespace v2rayN.Forms
}
VmessItem item = config.vmess[k];
void _addSubItem(ListViewItem i, string name, string text)
{
i.SubItems.Add(new ListViewItem.ListViewSubItem() { Name = name, Text = text });
}
bool stats = statistics != null && statistics.Enable;
if (stats)
{
@ -241,20 +237,20 @@ namespace v2rayN.Forms
}
}
ListViewItem lvItem = new ListViewItem(def);
_addSubItem(lvItem, EServerColName.configType.ToString(), ((EConfigType)item.configType).ToString());
_addSubItem(lvItem, EServerColName.remarks.ToString(), item.remarks);
_addSubItem(lvItem, EServerColName.address.ToString(), item.address);
_addSubItem(lvItem, EServerColName.port.ToString(), item.port.ToString());
_addSubItem(lvItem, EServerColName.security.ToString(), item.security);
_addSubItem(lvItem, EServerColName.network.ToString(), item.network);
_addSubItem(lvItem, EServerColName.subRemarks.ToString(), item.getSubRemarks(config));
_addSubItem(lvItem, EServerColName.testResult.ToString(), item.testResult);
Utils.AddSubItem(lvItem, EServerColName.configType.ToString(), ((EConfigType)item.configType).ToString());
Utils.AddSubItem(lvItem, EServerColName.remarks.ToString(), item.remarks);
Utils.AddSubItem(lvItem, EServerColName.address.ToString(), item.address);
Utils.AddSubItem(lvItem, EServerColName.port.ToString(), item.port.ToString());
Utils.AddSubItem(lvItem, EServerColName.security.ToString(), item.security);
Utils.AddSubItem(lvItem, EServerColName.network.ToString(), item.network);
Utils.AddSubItem(lvItem, EServerColName.subRemarks.ToString(), item.getSubRemarks(config));
Utils.AddSubItem(lvItem, EServerColName.testResult.ToString(), item.testResult);
if (stats)
{
_addSubItem(lvItem, EServerColName.todayDown.ToString(), todayDown);
_addSubItem(lvItem, EServerColName.todayUp.ToString(), todayUp);
_addSubItem(lvItem, EServerColName.totalDown.ToString(), totalDown);
_addSubItem(lvItem, EServerColName.totalUp.ToString(), totalUp);
Utils.AddSubItem(lvItem, EServerColName.todayDown.ToString(), todayDown);
Utils.AddSubItem(lvItem, EServerColName.todayUp.ToString(), todayUp);
Utils.AddSubItem(lvItem, EServerColName.totalDown.ToString(), totalDown);
Utils.AddSubItem(lvItem, EServerColName.totalUp.ToString(), totalUp);
}
if (k % 2 == 1) // 隔行着色
@ -1138,17 +1134,15 @@ namespace v2rayN.Forms
#endregion
#region 系统代理相关
private void menuKeepClear_Click(object sender, EventArgs e)
{
SetListenerType(ESysProxyType.ForcedClear);
}
private void menuGlobal_Click(object sender, EventArgs e)
{
SetListenerType(ESysProxyType.ForcedChange);
}
private void menuKeepClear_Click(object sender, EventArgs e)
{
SetListenerType(ESysProxyType.ForcedClear);
}
private void menuKeepNothing_Click(object sender, EventArgs e)
{
SetListenerType(ESysProxyType.Unchanged);

View File

@ -226,7 +226,7 @@
<value>tsbCheckUpdateN</value>
</data>
<data name="menuKeepNothing.Text" xml:space="preserve">
<value>Only open Http proxy and do nothing</value>
<value>Do not change system proxy</value>
</data>
<data name="&gt;&gt;menuMoveBottom.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
@ -585,7 +585,7 @@
<value>265, 142</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 22</value>
<value>262, 22</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
@ -1103,7 +1103,7 @@
<value>Magenta</value>
</data>
<data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 22</value>
<value>262, 22</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>355, 22</value>
@ -1148,7 +1148,7 @@
<value>Vertical</value>
</data>
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 22</value>
<value>262, 22</value>
</data>
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
<value>355, 22</value>
@ -1174,6 +1174,9 @@
<data name="&gt;&gt;menuServers.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="menuKeepClear.Text" xml:space="preserve">
<value>Clear system proxy</value>
</data>
<data name="menuPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>355, 22</value>
</data>
@ -1217,7 +1220,7 @@
<value>notifyMain</value>
</data>
<data name="menuGlobal.Text" xml:space="preserve">
<value>Open Http proxy and set the system proxy (global mode)</value>
<value>Set system proxy (global mode)</value>
</data>
<data name="&gt;&gt;tsbQRCodeSwitch.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
@ -1415,9 +1418,6 @@
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>228, 18</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>zh-Hans</value>
</metadata>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

View File

@ -312,11 +312,11 @@
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing">
<value>228, 22</value>
</data>
<data name="menuKeepNothing.Text" xml:space="preserve">
<value>不改变系统代理</value>
<data name="menuKeepClear.Text" xml:space="preserve">
<value>清除系统代理</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>228, 22</value>
@ -324,11 +324,11 @@
<data name="menuGlobal.Text" xml:space="preserve">
<value>自动配置系统代理(全局模式)</value>
</data>
<data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing">
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>228, 22</value>
</data>
<data name="menuKeepClear.Text" xml:space="preserve">
<value>清除系统代理</value>
<data name="menuKeepNothing.Text" xml:space="preserve">
<value>不改变系统代理</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
@ -441,19 +441,19 @@
<value> 重启服务 </value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
<value>135, 22</value>
</data>
<data name="tsbCheckUpdateN.Text" xml:space="preserve">
<value>v2rayN</value>
</data>
<data name="tsbCheckUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
<value>135, 22</value>
</data>
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
<value>v2fly-Core</value>
</data>
<data name="tsbCheckUpdateXrayCore.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
<value>135, 22</value>
</data>
<data name="tsbCheckUpdateXrayCore.Text" xml:space="preserve">
<value>Xray-Core</value>

View File

@ -69,6 +69,8 @@
this.txtKcpmtu = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.cmbCoreType = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.chkKeepOlderDedupl = new System.Windows.Forms.CheckBox();
this.cbFreshrate = new System.Windows.Forms.ComboBox();
this.lbFreshrate = new System.Windows.Forms.Label();
@ -89,31 +91,32 @@
//
// 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);
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.chkdefAllowInsecure);
this.groupBox1.Controls.Add(this.chksniffingEnabled2);
this.groupBox1.Controls.Add(this.chksniffingEnabled);
@ -131,7 +134,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;
//
@ -174,12 +176,12 @@
//
// cmbprotocol2
//
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbprotocol2.FormattingEnabled = true;
this.cmbprotocol2.Items.AddRange(new object[] {
resources.GetString("cmbprotocol2.Items"),
resources.GetString("cmbprotocol2.Items1")});
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
this.cmbprotocol2.Name = "cmbprotocol2";
//
// label3
@ -194,8 +196,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"),
@ -221,6 +223,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[] {
@ -229,7 +232,6 @@
resources.GetString("cmbloglevel.Items2"),
resources.GetString("cmbloglevel.Items3"),
resources.GetString("cmbloglevel.Items4")});
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.Name = "cmbloglevel";
//
// label5
@ -249,10 +251,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;
//
@ -274,6 +276,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);
@ -287,7 +290,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;
//
@ -359,16 +361,33 @@
//
// tabPage7
//
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Controls.Add(this.cmbCoreType);
this.tabPage7.Controls.Add(this.label4);
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.chkAllowLANConn);
this.tabPage7.Controls.Add(this.chkAutoRun);
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true;
//
// cmbCoreType
//
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
this.cmbCoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType.FormattingEnabled = true;
this.cmbCoreType.Items.AddRange(new object[] {
resources.GetString("cmbCoreType.Items"),
resources.GetString("cmbCoreType.Items1")});
this.cmbCoreType.Name = "cmbCoreType";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// chkKeepOlderDedupl
//
resources.ApplyResources(this.chkKeepOlderDedupl, "chkKeepOlderDedupl");
@ -377,9 +396,9 @@
//
// cbFreshrate
//
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbFreshrate.FormattingEnabled = true;
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.Name = "cbFreshrate";
//
// lbFreshrate
@ -407,9 +426,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
@ -501,5 +520,7 @@
private System.Windows.Forms.LinkLabel linkDnsObjectDoc;
private System.Windows.Forms.TextBox txtremoteDNS;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.ComboBox cmbCoreType;
private System.Windows.Forms.Label label4;
}
}

View File

@ -120,6 +120,7 @@ namespace v2rayN.Forms
break;
}
cmbCoreType.SelectedIndex = (int)config.coreType;
}
private void btnOK_Click(object sender, EventArgs e)
{
@ -284,6 +285,7 @@ namespace v2rayN.Forms
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue;
config.keepOlderDedupl = chkKeepOlderDedupl.Checked;
config.coreType = (ECoreType)cmbCoreType.SelectedIndex;
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -121,12 +121,6 @@
<value>取消(&amp;C)</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>161, 12</value>
</data>
<data name="linkDnsObjectDoc.Text" xml:space="preserve">
<value>支持填写DnsObject,JSON格式</value>
</data>
<data name="chkdefAllowInsecure.Size" type="System.Drawing.Size, System.Drawing">
<value>336, 16</value>
</data>
@ -145,12 +139,6 @@
<data name="chksniffingEnabled.Text" xml:space="preserve">
<value>开启流量探测</value>
</data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value>
</data>
<data name="label14.Text" xml:space="preserve">
<value>自定义DNS(可多个,用逗号(,)隔开)</value>
</data>
<data name="chkmuxEnabled.Text" xml:space="preserve">
<value>开启Mux多路复用(默认开启)</value>
</data>
@ -211,6 +199,18 @@
<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>
<data name="linkDnsObjectDoc.Text" xml:space="preserve">
<value>支持填写DnsObject,JSON格式</value>
</data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value>
</data>
<data name="label14.Text" xml:space="preserve">
<value>自定义DNS(可多个,用逗号(,)隔开)</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
@ -223,6 +223,12 @@
<data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>Core类型</value>
</data>
<data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 16</value>
</data>

View File

@ -1,135 +0,0 @@
namespace v2rayN.Forms
{
partial class RoutingSettingControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingSettingControl));
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnExpand = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.cmbOutboundTag = new System.Windows.Forms.ComboBox();
this.btnRemove = new System.Windows.Forms.Button();
this.txtUserRule = new System.Windows.Forms.TextBox();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.btnExpand);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.cmbOutboundTag);
this.groupBox2.Controls.Add(this.btnRemove);
this.groupBox2.Controls.Add(this.txtUserRule);
this.groupBox2.Controls.Add(this.txtRemarks);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// btnExpand
//
resources.ApplyResources(this.btnExpand, "btnExpand");
this.btnExpand.Name = "btnExpand";
this.btnExpand.UseVisualStyleBackColor = true;
this.btnExpand.Click += new System.EventHandler(this.btnExpand_Click);
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// cmbOutboundTag
//
resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag");
this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbOutboundTag.FormattingEnabled = true;
this.cmbOutboundTag.Items.AddRange(new object[] {
resources.GetString("cmbOutboundTag.Items"),
resources.GetString("cmbOutboundTag.Items1"),
resources.GetString("cmbOutboundTag.Items2")});
this.cmbOutboundTag.Name = "cmbOutboundTag";
//
// btnRemove
//
resources.ApplyResources(this.btnRemove, "btnRemove");
this.btnRemove.Name = "btnRemove";
this.btnRemove.UseVisualStyleBackColor = true;
this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click);
//
// txtUserRule
//
resources.ApplyResources(this.txtUserRule, "txtUserRule");
this.txtUserRule.Name = "txtUserRule";
this.txtUserRule.Leave += new System.EventHandler(this.txtRemarks_Leave);
//
// txtRemarks
//
resources.ApplyResources(this.txtRemarks, "txtRemarks");
this.txtRemarks.Name = "txtRemarks";
this.txtRemarks.Leave += new System.EventHandler(this.txtRemarks_Leave);
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// RoutingSettingControl
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox2);
this.Name = "RoutingSettingControl";
this.Load += new System.EventHandler(this.RoutingSettingControl_Load);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtUserRule;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button btnRemove;
private System.Windows.Forms.ComboBox cmbOutboundTag;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Button btnExpand;
}
}

View File

@ -1,73 +0,0 @@
using System;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingSettingControl : UserControl
{
public event ChangeEventHandler OnButtonClicked;
public RoutingItem routingItem
{
get; set;
}
public RoutingSettingControl()
{
InitializeComponent();
}
private void RoutingSettingControl_Load(object sender, EventArgs e)
{
BindingSub();
}
private void BindingSub()
{
if (routingItem != null)
{
txtRemarks.Text = routingItem.remarks.ToString();
cmbOutboundTag.Text = routingItem.outboundTag;
txtUserRule.Text = Utils.List2String(routingItem.userRules, true);
}
}
private void EndBindingSub()
{
if (routingItem != null)
{
routingItem.remarks = txtRemarks.Text.TrimEx();
routingItem.outboundTag = cmbOutboundTag.Text;
routingItem.userRules = Utils.String2List(txtUserRule.Text);
}
}
private void txtRemarks_Leave(object sender, EventArgs e)
{
EndBindingSub();
}
private void btnRemove_Click(object sender, EventArgs e)
{
if (routingItem != null)
{
routingItem.remarks = string.Empty;
}
OnButtonClicked?.Invoke(sender, e);
}
private void btnExpand_Click(object sender, EventArgs e)
{
if (this.Height > 200)
{
this.Height = 160;
}
else
{
this.Height = 500;
}
}
}
}

View File

@ -0,0 +1,211 @@
namespace v2rayN.Forms
{
partial class RoutingSettingDetailsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingSettingDetailsForm));
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.txtPort = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.labRoutingTips = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.cmbOutboundTag = new System.Windows.Forms.ComboBox();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.panel4 = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtIP = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtDomain = new System.Windows.Forms.TextBox();
this.panel3.SuspendLayout();
this.panel4.SuspendLayout();
this.panel2.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// panel3
//
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.txtPort);
this.panel3.Controls.Add(this.label1);
this.panel3.Controls.Add(this.labRoutingTips);
this.panel3.Controls.Add(this.label4);
this.panel3.Controls.Add(this.cmbOutboundTag);
this.panel3.Controls.Add(this.txtRemarks);
this.panel3.Controls.Add(this.label2);
this.panel3.Name = "panel3";
//
// txtPort
//
resources.ApplyResources(this.txtPort, "txtPort");
this.txtPort.Name = "txtPort";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// labRoutingTips
//
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
this.labRoutingTips.Name = "labRoutingTips";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// cmbOutboundTag
//
resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag");
this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbOutboundTag.FormattingEnabled = true;
this.cmbOutboundTag.Items.AddRange(new object[] {
resources.GetString("cmbOutboundTag.Items"),
resources.GetString("cmbOutboundTag.Items1"),
resources.GetString("cmbOutboundTag.Items2")});
this.cmbOutboundTag.Name = "cmbOutboundTag";
//
// txtRemarks
//
resources.ApplyResources(this.txtRemarks, "txtRemarks");
this.txtRemarks.Name = "txtRemarks";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// panel4
//
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.btnClose);
this.panel4.Controls.Add(this.btnOK);
this.panel4.Name = "panel4";
//
// btnClose
//
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);
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.groupBox2);
this.panel2.Controls.Add(this.groupBox1);
this.panel2.Name = "panel2";
//
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.txtIP);
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// txtIP
//
resources.ApplyResources(this.txtIP, "txtIP");
this.txtIP.Name = "txtIP";
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.txtDomain);
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// txtDomain
//
resources.ApplyResources(this.txtDomain, "txtDomain");
this.txtDomain.Name = "txtDomain";
//
// RoutingSettingDetailsForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel4);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel1);
this.Name = "RoutingSettingDetailsForm";
this.Load += new System.EventHandler(this.RoutingSettingDetailsForm_Load);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox cmbOutboundTag;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtDomain;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtIP;
private System.Windows.Forms.Label labRoutingTips;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtPort;
}
}

View File

@ -0,0 +1,86 @@
using System;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingSettingDetailsForm : BaseForm
{
public int EditIndex
{
get; set;
}
protected RulesItem routingItem = null;
public RoutingSettingDetailsForm()
{
InitializeComponent();
}
private void RoutingSettingDetailsForm_Load(object sender, EventArgs e)
{
if (EditIndex >= 0)
{
routingItem = config.rules[EditIndex];
BindingData();
}
else
{
routingItem = new RulesItem();
ClearBind();
}
}
private void EndBindingData()
{
if (routingItem != null)
{
routingItem.remarks = txtRemarks.Text.TrimEx();
routingItem.port = txtPort.Text.TrimEx();
routingItem.outboundTag = cmbOutboundTag.Text;
routingItem.domain = Utils.String2List(txtDomain.Text);
routingItem.ip = Utils.String2List(txtIP.Text);
}
}
private void BindingData()
{
if (routingItem != null)
{
txtRemarks.Text = routingItem.remarks ?? string.Empty;
txtPort.Text = routingItem.port ?? string.Empty;
cmbOutboundTag.Text = routingItem.outboundTag;
txtDomain.Text = Utils.List2String(routingItem.domain, true);
txtIP.Text = Utils.List2String(routingItem.ip, true);
}
}
private void ClearBind()
{
txtRemarks.Text = string.Empty;
txtPort.Text = string.Empty;
cmbOutboundTag.Text = Global.agentTag;
txtDomain.Text = string.Empty;
txtIP.Text = string.Empty;
}
private void btnOK_Click(object sender, EventArgs e)
{
EndBindingData();
if (ConfigHandler.AddRoutingRule(ref config, routingItem, EditIndex) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
this.DialogResult = DialogResult.OK;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View File

@ -117,274 +117,472 @@
<resheader name="writer">
<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="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>733, 164</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>Rule</value>
</data>
<data name="cmbOutboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 20</value>
</data>
<data name="cmbOutboundTag.Items1" xml:space="preserve">
<value>direct</value>
</data>
<data name="&gt;&gt;txtUserRule.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="txtUserRule.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 50</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnRemove.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="txtUserRule.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="&gt;&gt;txtUserRule.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingSettingControl</value>
</data>
<data name="btnExpand.Text" xml:space="preserve">
<value>Expand</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>28</value>
<value>32</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>5</value>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
</data>
<data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="cmbOutboundTag.Items" xml:space="preserve">
<value>proxy</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="btnExpand.Location" type="System.Drawing.Point, System.Drawing">
<value>544, 21</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 21</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;btnExpand.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnExpand.Name" xml:space="preserve">
<value>btnExpand</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 87</value>
</data>
<data name="&gt;&gt;txtUserRule.Name" xml:space="preserve">
<value>txtUserRule</value>
</data>
<data name="txtUserRule.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnExpand.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="btnExpand.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labRoutingTips.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Left</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnRemove.Name" xml:space="preserve">
<value>btnRemove</value>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
<data name="&gt;&gt;groupBox2.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="btnExpand.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
<data name="$this.Text" xml:space="preserve">
<value>RoutingSettingDetailsForm</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
<data name="txtIP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>Out Tag</value>
</data>
<data name="cmbOutboundTag.Items2" xml:space="preserve">
<value>block</value>
</data>
<data name="btnRemove.Text" xml:space="preserve">
<value>Remove</value>
</data>
<data name="&gt;&gt;btnRemove.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnExpand.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>groupBox2</value>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>groupBox2</value>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>411, 15</value>
</data>
<data name="txtUserRule.Size" type="System.Drawing.Size, System.Drawing">
<value>588, 105</value>
<data name="cmbOutboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 20</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
<data name="&gt;&gt;panel1.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="&gt;&gt;btnExpand.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="&gt;&gt;txtUserRule.Parent" xml:space="preserve">
<value>groupBox2</value>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtIP.Size" type="System.Drawing.Size, System.Drawing">
<value>344, 417</value>
</data>
<data name="&gt;&gt;panel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>504, 15</value>
</data>
<data name="&gt;&gt;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="labRoutingTips.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;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="&gt;&gt;cmbOutboundTag.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>733, 164</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="txtUserRule.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left, Right</value>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>362, 21</value>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 437</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Name" xml:space="preserve">
<value>cmbOutboundTag</value>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;panel3.Name" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 43</value>
</data>
<data name="txtIP.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="txtDomain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="&gt;&gt;labRoutingTips.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 20</value>
</data>
<data name="&gt;&gt;labRoutingTips.Name" xml:space="preserve">
<value>labRoutingTips</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>491, 20</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingSettingDetailsForm</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>166, 21</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtPort.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>544, 16</value>
</data>
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>392, 0</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel4.Name" xml:space="preserve">
<value>panel4</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>598, 16</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;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="&gt;&gt;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="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="txtIP.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="&gt;&gt;panel4.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 10</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;labRoutingTips.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
</data>
<data name="cmbOutboundTag.Items2" xml:space="preserve">
<value>block</value>
</data>
<data name="cmbOutboundTag.Items1" xml:space="preserve">
<value>direct</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;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="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;panel3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>110, 21</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="panel3.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="panel3.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 60</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 79</value>
</data>
<data name="&gt;&gt;panel4.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 69</value>
</data>
<data name="txtIP.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Port</value>
</data>
<data name="&gt;&gt;txtPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;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="&gt;&gt;txtIP.Name" xml:space="preserve">
<value>txtIP</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Name" xml:space="preserve">
<value>cmbOutboundTag</value>
</data>
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 25</value>
<value>19, 20</value>
</data>
<data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>742, 576</value>
</data>
<data name="panel4.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>301, 26</value>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;txtDomain.Name" xml:space="preserve">
<value>txtDomain</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>84, 16</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>IP</value>
</data>
<data name="&gt;&gt;panel3.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="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel4.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 516</value>
</data>
<data name="labRoutingTips.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>162, 21</value>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>350, 437</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Domain or IP</value>
<data name="groupBox1.Text" xml:space="preserve">
<value>Domain</value>
</data>
<data name="&gt;&gt;groupBox2.Parent" xml:space="preserve">
<value>$this</value>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;btnRemove.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>347, 16</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="label4.Text" xml:space="preserve">
<value>Out Tag</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>640, 21</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>zh-Hans</value>
</metadata>
</root>

View File

@ -117,47 +117,29 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的路由规则,用逗号(,)分隔</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnExpand.Location" type="System.Drawing.Point, System.Drawing">
<value>526, 20</value>
</data>
<data name="btnExpand.Text" xml:space="preserve">
<value>扩大</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
<value>71, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>出口标签</value>
</data>
<data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>619, 20</value>
</data>
<data name="btnRemove.Text" xml:space="preserve">
<value>移除</value>
</data>
<data name="txtUserRule.Size" type="System.Drawing.Size, System.Drawing">
<value>567, 104</value>
<value>OutboundTag</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>备注</value>
<value>别名</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>域名或IP</value>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>709, 160</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>规则</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>709, 160</value>
<data name="$this.Text" xml:space="preserve">
<value>路由规则详情设置</value>
</data>
</root>

View File

@ -28,19 +28,39 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingSettingForm));
this.btnClose = new System.Windows.Forms.Button();
this.panCon = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.btnAdd = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.btnSetDefRountingRule = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.labRoutingTips = new System.Windows.Forms.Label();
this.linkLabelRoutingDoc = new System.Windows.Forms.LinkLabel();
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
this.lvRoutings = new v2rayN.Base.ListViewFlickerFree();
this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuAdd = new System.Windows.Forms.ToolStripMenuItem();
this.menuRemove = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuExportSelectedRules = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.menuMoveTop = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveUp = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveDown = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveBottom = new System.Windows.Forms.ToolStripMenuItem();
this.MenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.menuServer = new System.Windows.Forms.MenuStrip();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportRulesFromPreset = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportRulesFromFile = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportRulesFromClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.cmsLv.SuspendLayout();
this.tabControl2.SuspendLayout();
this.tabPage2.SuspendLayout();
this.menuServer.SuspendLayout();
this.SuspendLayout();
//
// btnClose
@ -51,26 +71,13 @@
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// panCon
//
resources.ApplyResources(this.panCon, "panCon");
this.panCon.Name = "panCon";
//
// panel2
//
this.panel2.Controls.Add(this.btnAdd);
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// btnAdd
//
resources.ApplyResources(this.btnAdd, "btnAdd");
this.btnAdd.Name = "btnAdd";
this.btnAdd.UseVisualStyleBackColor = true;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
@ -78,28 +85,13 @@
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnSetDefRountingRule
//
resources.ApplyResources(this.btnSetDefRountingRule, "btnSetDefRountingRule");
this.btnSetDefRountingRule.Name = "btnSetDefRountingRule";
this.btnSetDefRountingRule.UseVisualStyleBackColor = true;
this.btnSetDefRountingRule.Click += new System.EventHandler(this.btnSetDefRountingRule_Click);
//
// panel1
//
this.panel1.Controls.Add(this.btnSetDefRountingRule);
this.panel1.Controls.Add(this.labRoutingTips);
this.panel1.Controls.Add(this.linkLabelRoutingDoc);
this.panel1.Controls.Add(this.cmbdomainStrategy);
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// labRoutingTips
//
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips";
//
// linkLabelRoutingDoc
//
resources.ApplyResources(this.linkLabelRoutingDoc, "linkLabelRoutingDoc");
@ -118,21 +110,169 @@
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
//
// lvRoutings
//
this.lvRoutings.ContextMenuStrip = this.cmsLv;
resources.ApplyResources(this.lvRoutings, "lvRoutings");
this.lvRoutings.FullRowSelect = true;
this.lvRoutings.GridLines = true;
this.lvRoutings.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.lvRoutings.HideSelection = false;
this.lvRoutings.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
((System.Windows.Forms.ListViewItem)(resources.GetObject("lvRoutings.Items")))});
this.lvRoutings.MultiSelect = false;
this.lvRoutings.Name = "lvRoutings";
this.lvRoutings.UseCompatibleStateImageBehavior = false;
this.lvRoutings.View = System.Windows.Forms.View.Details;
this.lvRoutings.DoubleClick += new System.EventHandler(this.lvRoutings_DoubleClick);
this.lvRoutings.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvRoutings_KeyDown);
//
// cmsLv
//
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuAdd,
this.menuRemove,
this.menuSelectAll,
this.menuExportSelectedRules,
this.toolStripSeparator3,
this.menuMoveTop,
this.menuMoveUp,
this.menuMoveDown,
this.menuMoveBottom});
this.cmsLv.Name = "cmsLv";
resources.ApplyResources(this.cmsLv, "cmsLv");
//
// menuAdd
//
this.menuAdd.Name = "menuAdd";
resources.ApplyResources(this.menuAdd, "menuAdd");
this.menuAdd.Click += new System.EventHandler(this.menuAdd_Click);
//
// menuRemove
//
this.menuRemove.Name = "menuRemove";
resources.ApplyResources(this.menuRemove, "menuRemove");
this.menuRemove.Click += new System.EventHandler(this.menuRemove_Click);
//
// menuSelectAll
//
this.menuSelectAll.Name = "menuSelectAll";
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
//
// menuExportSelectedRules
//
this.menuExportSelectedRules.Name = "menuExportSelectedRules";
resources.ApplyResources(this.menuExportSelectedRules, "menuExportSelectedRules");
this.menuExportSelectedRules.Click += new System.EventHandler(this.menuExportSelectedRules_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
//
// menuMoveTop
//
this.menuMoveTop.Name = "menuMoveTop";
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click);
//
// menuMoveUp
//
this.menuMoveUp.Name = "menuMoveUp";
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click);
//
// menuMoveDown
//
this.menuMoveDown.Name = "menuMoveDown";
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click);
//
// menuMoveBottom
//
this.menuMoveBottom.Name = "menuMoveBottom";
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click);
//
// MenuItem1
//
this.MenuItem1.DropDown = this.cmsLv;
this.MenuItem1.Name = "MenuItem1";
resources.ApplyResources(this.MenuItem1, "MenuItem1");
//
// tabControl2
//
this.tabControl2.Controls.Add(this.tabPage2);
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.lvRoutings);
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// menuServer
//
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItem1,
this.toolStripMenuItem1});
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Name = "menuServer";
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuImportRulesFromPreset,
this.menuImportRulesFromFile,
this.menuImportRulesFromClipboard});
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1");
//
// menuImportRulesFromPreset
//
this.menuImportRulesFromPreset.Name = "menuImportRulesFromPreset";
resources.ApplyResources(this.menuImportRulesFromPreset, "menuImportRulesFromPreset");
this.menuImportRulesFromPreset.Click += new System.EventHandler(this.menuImportRulesFromPreset_Click);
//
// menuImportRulesFromFile
//
this.menuImportRulesFromFile.Name = "menuImportRulesFromFile";
resources.ApplyResources(this.menuImportRulesFromFile, "menuImportRulesFromFile");
this.menuImportRulesFromFile.Click += new System.EventHandler(this.menuImportRulesFromFile_Click);
//
// menuImportRulesFromClipboard
//
this.menuImportRulesFromClipboard.Name = "menuImportRulesFromClipboard";
resources.ApplyResources(this.menuImportRulesFromClipboard, "menuImportRulesFromClipboard");
this.menuImportRulesFromClipboard.Click += new System.EventHandler(this.menuImportRulesFromClipboard_Click);
//
// RoutingSettingForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.panCon);
this.Controls.Add(this.tabControl2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.menuServer);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "RoutingSettingForm";
this.Load += new System.EventHandler(this.RoutingSettingForm_Load);
this.panel2.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.cmsLv.ResumeLayout(false);
this.tabControl2.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.menuServer.ResumeLayout(false);
this.menuServer.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -140,12 +280,27 @@
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Panel panCon;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label labRoutingTips;
private System.Windows.Forms.LinkLabel linkLabelRoutingDoc;
private System.Windows.Forms.ComboBox cmbdomainStrategy;
private System.Windows.Forms.Button btnSetDefRountingRule;
private Base.ListViewFlickerFree lvRoutings;
private System.Windows.Forms.TabControl tabControl2;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.ContextMenuStrip cmsLv;
private System.Windows.Forms.ToolStripMenuItem menuRemove;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
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 menuSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuAdd;
private System.Windows.Forms.MenuStrip menuServer;
private System.Windows.Forms.ToolStripMenuItem MenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem menuImportRulesFromPreset;
private System.Windows.Forms.ToolStripMenuItem menuImportRulesFromFile;
private System.Windows.Forms.ToolStripMenuItem menuImportRulesFromClipboard;
private System.Windows.Forms.ToolStripMenuItem menuExportSelectedRules;
}
}

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
@ -8,8 +9,7 @@ namespace v2rayN.Forms
{
public partial class RoutingSettingForm : BaseForm
{
List<RoutingSettingControl> lstControls = new List<RoutingSettingControl>();
private List<int> lvSelecteds = new List<int>();
public RoutingSettingForm()
{
InitializeComponent();
@ -19,59 +19,61 @@ namespace v2rayN.Forms
{
cmbdomainStrategy.Text = config.domainStrategy;
if (config.routingItem == null)
if (config.rules == null)
{
config.routingItem = new List<RoutingItem>();
config.rules = new List<RulesItem>();
}
RefreshSubsView();
InitRoutingsView();
RefreshRoutingsView();
}
/// <summary>
/// 刷新列表
/// </summary>
private void RefreshSubsView()
private void InitRoutingsView()
{
panCon.Controls.Clear();
lstControls.Clear();
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
for (int k = config.routingItem.Count - 1; k >= 0; k--)
{
RoutingItem item = config.routingItem[k];
if (Utils.IsNullOrEmpty(item.remarks))
{
config.routingItem.RemoveAt(k);
}
}
lvRoutings.GridLines = true;
lvRoutings.FullRowSelect = true;
lvRoutings.View = View.Details;
lvRoutings.MultiSelect = true;
lvRoutings.HeaderStyle = ColumnHeaderStyle.Clickable;
foreach (RoutingItem item in config.routingItem)
{
RoutingSettingControl control = new RoutingSettingControl();
control.OnButtonClicked += Control_OnButtonClicked;
control.routingItem = item;
control.Dock = DockStyle.Top;
lvRoutings.Columns.Add("", 30);
lvRoutings.Columns.Add(UIRes.I18N("LvAlias"), 100);
lvRoutings.Columns.Add("outboundTag", 80);
lvRoutings.Columns.Add("port", 80);
lvRoutings.Columns.Add("domain", 200);
lvRoutings.Columns.Add("ip", 200);
panCon.Controls.Add(control);
panCon.Controls.SetChildIndex(control, 0);
lstControls.Add(control);
}
lvRoutings.EndUpdate();
}
private void Control_OnButtonClicked(object sender, EventArgs e)
private void RefreshRoutingsView()
{
RefreshSubsView();
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
for (int k = 0; k < config.rules.Count; k++)
{
var item = config.rules[k];
ListViewItem lvItem = new ListViewItem("");
Utils.AddSubItem(lvItem, "remarks", item.remarks);
Utils.AddSubItem(lvItem, "outboundTag", item.outboundTag);
Utils.AddSubItem(lvItem, "port", item.port);
Utils.AddSubItem(lvItem, "domain", Utils.List2String(item.domain));
Utils.AddSubItem(lvItem, "ip", Utils.List2String(item.ip));
if (lvItem != null) lvRoutings.Items.Add(lvItem);
}
lvRoutings.EndUpdate();
}
private void btnOK_Click(object sender, EventArgs e)
{
config.domainStrategy = cmbdomainStrategy.Text;
if (config.routingItem.Count <= 0)
{
AddSub("proxy", "");
}
if (ConfigHandler.SaveRoutingItem(ref config) == 0)
if (ConfigHandler.SaveRoutingRulesItem(ref config) == 0)
{
this.DialogResult = DialogResult.OK;
}
@ -79,7 +81,6 @@ namespace v2rayN.Forms
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
@ -87,58 +88,226 @@ namespace v2rayN.Forms
this.DialogResult = DialogResult.Cancel;
}
private void btnAdd_Click(object sender, EventArgs e)
{
AddSub("proxy", "");
RefreshSubsView();
}
private void AddSub(string outboundTag, string userRule)
{
RoutingItem RoutingItem = new RoutingItem
{
remarks = outboundTag,
outboundTag = outboundTag,
userRules = Utils.String2List(userRule)
};
config.routingItem.Add(RoutingItem);
}
private void btnSetDefRountingRule_Click(object sender, EventArgs e)
{
config.routingItem.Clear();
List<string> lstTag = new List<string>
{
Global.agentTag,
Global.directTag,
Global.blockTag
};
for (int k = 0; k < lstTag.Count; k++)
{
DownloadHandle downloadHandle = new DownloadHandle();
string result = downloadHandle.WebDownloadStringSync(Global.CustomRoutingListUrl + lstTag[k]);
if (Utils.IsNullOrEmpty(result))
{
result = Utils.GetEmbedText(Global.CustomRoutingFileName + lstTag[k]);
}
AddSub(lstTag[k], result);
}
AddSub(Global.directTag, Utils.GetEmbedText(Global.CustomRoutingFileName + "private"));
AddSub(Global.agentTag, "");
RefreshSubsView();
}
private void linkLabelRoutingDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://www.v2fly.org/config/routing.html");
}
private void lvRoutings_DoubleClick(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
var fm = new RoutingSettingDetailsForm();
fm.EditIndex = index;
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshRoutingsView();
}
}
private int GetLvSelectedIndex()
{
int index = -1;
lvSelecteds.Clear();
try
{
if (lvRoutings.SelectedIndices.Count <= 0)
{
UI.Show(UIRes.I18N("PleaseSelectRules"));
return index;
}
index = lvRoutings.SelectedIndices[0];
foreach (int i in lvRoutings.SelectedIndices)
{
lvSelecteds.Add(i);
}
return index;
}
catch
{
return index;
}
}
#region Edit function
private void menuMoveTop_Click(object sender, EventArgs e)
{
MoveRule(EMove.Top);
}
private void menuMoveUp_Click(object sender, EventArgs e)
{
MoveRule(EMove.Up);
}
private void menuMoveDown_Click(object sender, EventArgs e)
{
MoveRule(EMove.Down);
}
private void menuMoveBottom_Click(object sender, EventArgs e)
{
MoveRule(EMove.Bottom);
}
private void MoveRule(EMove eMove)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
UI.Show(UIRes.I18N("PleaseSelectRules"));
return;
}
if (ConfigHandler.MoveRoutingRule(ref config, index, eMove) == 0)
{
RefreshRoutingsView();
}
}
private void menuSelectAll_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in lvRoutings.Items)
{
item.Selected = true;
}
}
private void menuAdd_Click(object sender, EventArgs e)
{
var fm = new RoutingSettingDetailsForm();
fm.EditIndex = -1;
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshRoutingsView();
}
}
private void menuRemove_Click(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
if (UI.ShowYesNo(UIRes.I18N("RemoveRules")) == DialogResult.No)
{
return;
}
for (int k = lvSelecteds.Count - 1; k >= 0; k--)
{
config.rules.RemoveAt(index);
}
RefreshRoutingsView();
}
private void menuExportSelectedRules_Click(object sender, EventArgs e)
{
GetLvSelectedIndex();
var lst = new List<RulesItem>();
foreach (int v in lvSelecteds)
{
lst.Add(config.rules[v]);
}
if (lst.Count > 0)
{
Utils.SetClipboardData(Utils.ToJson(lst));
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
private void lvRoutings_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
switch (e.KeyCode)
{
case Keys.A:
menuSelectAll_Click(null, null);
break;
case Keys.C:
menuExportSelectedRules_Click(null, null);
break;
}
}
else
{
switch (e.KeyCode)
{
case Keys.Delete:
menuRemove_Click(null, null);
break;
case Keys.T:
menuMoveTop_Click(null, null);
break;
case Keys.B:
menuMoveBottom_Click(null, null);
break;
case Keys.U:
menuMoveUp_Click(null, null);
break;
case Keys.D:
menuMoveDown_Click(null, null);
break;
}
}
}
#endregion
#region preset rules
private void menuImportRulesFromPreset_Click(object sender, EventArgs e)
{
var rules = Utils.GetEmbedText(Global.CustomRoutingFileName + "rules");
if (ConfigHandler.AddBatchRoutingRules(ref config, rules) == 0)
{
RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
private void menuImportRulesFromFile_Click(object sender, EventArgs e)
{
OpenFileDialog fileDialog = new OpenFileDialog
{
Multiselect = false,
Filter = "Rules|*.json|All|*.*"
};
if (fileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
string fileName = fileDialog.FileName;
if (Utils.IsNullOrEmpty(fileName))
{
return;
}
string result = Utils.LoadResource(fileName);
if (Utils.IsNullOrEmpty(result))
{
return;
}
if (ConfigHandler.AddBatchRoutingRules(ref config, result) == 0)
{
RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
private void menuImportRulesFromClipboard_Click(object sender, EventArgs e)
{
string clipboardData = Utils.GetClipboardData();
if (ConfigHandler.AddBatchRoutingRules(ref config, clipboardData) == 0)
{
RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
#endregion
}
}

View File

@ -145,60 +145,6 @@
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panCon.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="panCon.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="panCon.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 68</value>
</data>
<data name="panCon.Size" type="System.Drawing.Size, System.Drawing">
<value>765, 545</value>
</data>
<data name="panCon.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;panCon.Name" xml:space="preserve">
<value>panCon</value>
</data>
<data name="&gt;&gt;panCon.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="&gt;&gt;panCon.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panCon.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnAdd.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnAdd.Location" type="System.Drawing.Point, System.Drawing">
<value>47, 17</value>
</data>
<data name="btnAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnAdd.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="btnAdd.Text" xml:space="preserve">
<value>&amp;Add</value>
</data>
<data name="&gt;&gt;btnAdd.Name" xml:space="preserve">
<value>btnAdd</value>
</data>
<data name="&gt;&gt;btnAdd.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnAdd.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnAdd.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
@ -226,7 +172,7 @@
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>2</value>
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
@ -250,67 +196,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="btnSetDefRountingRule.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="btnSetDefRountingRule.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnSetDefRountingRule.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
<value>319, 17</value>
</data>
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>229, 23</value>
</data>
<data name="btnSetDefRountingRule.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
</data>
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
<value>Set default custom routing rules</value>
</data>
<data name="&gt;&gt;btnSetDefRountingRule.Name" xml:space="preserve">
<value>btnSetDefRountingRule</value>
</data>
<data name="&gt;&gt;btnSetDefRountingRule.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnSetDefRountingRule.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;btnSetDefRountingRule.ZOrder" xml:space="preserve">
<value>0</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>10, 42</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>598, 16</value>
</data>
<data name="labRoutingTips.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP</value>
</data>
<data name="&gt;&gt;labRoutingTips.Name" xml:space="preserve">
<value>labRoutingTips</value>
</data>
<data name="&gt;&gt;labRoutingTips.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labRoutingTips.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;labRoutingTips.ZOrder" xml:space="preserve">
<value>1</value>
<value>3</value>
</data>
<data name="linkLabelRoutingDoc.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -343,7 +229,7 @@
<value>panel1</value>
</data>
<data name="&gt;&gt;linkLabelRoutingDoc.ZOrder" xml:space="preserve">
<value>2</value>
<value>0</value>
</data>
<data name="cmbdomainStrategy.Items" xml:space="preserve">
<value>AsIs</value>
@ -373,16 +259,16 @@
<value>panel1</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.ZOrder" xml:space="preserve">
<value>3</value>
<value>1</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
<value>0, 25</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>765, 68</value>
<value>765, 51</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
@ -397,8 +283,217 @@
<value>$this</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<metadata name="cmsLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuAdd.Text" xml:space="preserve">
<value>Add</value>
</data>
<data name="menuRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuRemove.Text" xml:space="preserve">
<value>Remove selected</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>Select All (Ctrl+A)</value>
</data>
<data name="menuExportSelectedRules.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuExportSelectedRules.Text" xml:space="preserve">
<value>Export Selected Rules</value>
</data>
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>199, 6</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 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>202, 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>202, 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>202, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>Move to bottom (B)</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 186</value>
</data>
<data name="&gt;&gt;cmsLv.Name" xml:space="preserve">
<value>cmsLv</value>
</data>
<data name="&gt;&gt;cmsLv.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="lvRoutings.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="lvRoutings.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA
BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5
bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp
bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz
dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA
CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp
bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5
bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3
////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="lvRoutings.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>751, 505</value>
</data>
<data name="lvRoutings.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="&gt;&gt;lvRoutings.Name" xml:space="preserve">
<value>lvRoutings</value>
</data>
<data name="&gt;&gt;lvRoutings.Type" xml:space="preserve">
<value>v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvRoutings.Parent" xml:space="preserve">
<value>tabPage2</value>
</data>
<data name="&gt;&gt;lvRoutings.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Edit and Function</value>
</data>
<data name="tabPage2.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
</data>
<data name="tabPage2.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>757, 511</value>
</data>
<data name="tabPage2.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value>RuleList</value>
</data>
<data name="&gt;&gt;tabPage2.Name" xml:space="preserve">
<value>tabPage2</value>
</data>
<data name="&gt;&gt;tabPage2.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tabPage2.Parent" xml:space="preserve">
<value>tabControl2</value>
</data>
<data name="&gt;&gt;tabPage2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tabControl2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 76</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>765, 537</value>
</data>
<data name="tabControl2.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="&gt;&gt;tabControl2.Name" xml:space="preserve">
<value>tabControl2</value>
</data>
<data name="&gt;&gt;tabControl2.Type" xml:space="preserve">
<value>System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tabControl2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;tabControl2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<metadata name="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>139, 17</value>
</metadata>
<data name="menuImportRulesFromPreset.Size" type="System.Drawing.Size, System.Drawing">
<value>247, 22</value>
</data>
<data name="menuImportRulesFromPreset.Text" xml:space="preserve">
<value>Import Rules From Preset</value>
</data>
<data name="menuImportRulesFromFile.Size" type="System.Drawing.Size, System.Drawing">
<value>247, 22</value>
</data>
<data name="menuImportRulesFromFile.Text" xml:space="preserve">
<value>Import Rules From File</value>
</data>
<data name="menuImportRulesFromClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>247, 22</value>
</data>
<data name="menuImportRulesFromClipboard.Text" xml:space="preserve">
<value>Import Rules From Clipboard</value>
</data>
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 21</value>
</data>
<data name="toolStripMenuItem1.Text" xml:space="preserve">
<value>Import Rules</value>
</data>
<data name="menuServer.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>765, 25</value>
</data>
<data name="menuServer.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="&gt;&gt;menuServer.Name" xml:space="preserve">
<value>menuServer</value>
</data>
<data name="&gt;&gt;menuServer.Type" xml:space="preserve">
<value>System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuServer.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;menuServer.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -411,6 +506,90 @@
<data name="$this.Text" xml:space="preserve">
<value>Routing Settings</value>
</data>
<data name="&gt;&gt;menuAdd.Name" xml:space="preserve">
<value>menuAdd</value>
</data>
<data name="&gt;&gt;menuAdd.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuRemove.Name" xml:space="preserve">
<value>menuRemove</value>
</data>
<data name="&gt;&gt;menuRemove.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuSelectAll.Name" xml:space="preserve">
<value>menuSelectAll</value>
</data>
<data name="&gt;&gt;menuSelectAll.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuExportSelectedRules.Name" xml:space="preserve">
<value>menuExportSelectedRules</value>
</data>
<data name="&gt;&gt;menuExportSelectedRules.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripSeparator3.Name" xml:space="preserve">
<value>toolStripSeparator3</value>
</data>
<data name="&gt;&gt;toolStripSeparator3.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="&gt;&gt;menuMoveTop.Name" xml:space="preserve">
<value>menuMoveTop</value>
</data>
<data name="&gt;&gt;menuMoveTop.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMoveUp.Name" xml:space="preserve">
<value>menuMoveUp</value>
</data>
<data name="&gt;&gt;menuMoveUp.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMoveDown.Name" xml:space="preserve">
<value>menuMoveDown</value>
</data>
<data name="&gt;&gt;menuMoveDown.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMoveBottom.Name" xml:space="preserve">
<value>menuMoveBottom</value>
</data>
<data name="&gt;&gt;menuMoveBottom.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;MenuItem1.Name" xml:space="preserve">
<value>MenuItem1</value>
</data>
<data name="&gt;&gt;MenuItem1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripMenuItem1.Name" xml:space="preserve">
<value>toolStripMenuItem1</value>
</data>
<data name="&gt;&gt;toolStripMenuItem1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuImportRulesFromPreset.Name" xml:space="preserve">
<value>menuImportRulesFromPreset</value>
</data>
<data name="&gt;&gt;menuImportRulesFromPreset.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuImportRulesFromFile.Name" xml:space="preserve">
<value>menuImportRulesFromFile</value>
</data>
<data name="&gt;&gt;menuImportRulesFromFile.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuImportRulesFromClipboard.Name" xml:space="preserve">
<value>menuImportRulesFromClipboard</value>
</data>
<data name="&gt;&gt;menuImportRulesFromClipboard.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingSettingForm</value>
</data>

View File

@ -120,25 +120,141 @@
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnAdd.Text" xml:space="preserve">
<value>添加(&amp;A)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
<value>一键设置默认自定义路由规则</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 60</value>
</data>
<data name="linkLabelRoutingDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
</data>
<data name="linkLabelRoutingDoc.Text" xml:space="preserve">
<value>域名解析策略</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 51</value>
</data>
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuAdd.Text" xml:space="preserve">
<value>添加规则</value>
</data>
<data name="menuRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuRemove.Text" xml:space="preserve">
<value>移除所选规则</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>全选</value>
</data>
<data name="menuExportSelectedRules.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuExportSelectedRules.Text" xml:space="preserve">
<value>导出所选规则至剪贴板</value>
</data>
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>193, 6</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuMoveTop.Text" xml:space="preserve">
<value>上移至顶 (T)</value>
</data>
<data name="menuMoveUp.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuMoveUp.Text" xml:space="preserve">
<value>上移 (U)</value>
</data>
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuMoveDown.Text" xml:space="preserve">
<value>下移 (D)</value>
</data>
<data name="menuMoveBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>下移至底 (B)</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>92, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>路由规则功能</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>197, 186</value>
</data>
<data name="lvRoutings.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA
BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5
bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp
bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz
dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA
CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp
bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5
bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3
////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>771, 505</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>777, 511</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value>路由规则列表</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 537</value>
</data>
<data name="menuImportRulesFromPreset.Size" type="System.Drawing.Size, System.Drawing">
<value>184, 22</value>
</data>
<data name="menuImportRulesFromPreset.Text" xml:space="preserve">
<value>从预设中导入规则</value>
</data>
<data name="menuImportRulesFromFile.Size" type="System.Drawing.Size, System.Drawing">
<value>184, 22</value>
</data>
<data name="menuImportRulesFromFile.Text" xml:space="preserve">
<value>从文件中导入规则</value>
</data>
<data name="menuImportRulesFromClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>184, 22</value>
</data>
<data name="menuImportRulesFromClipboard.Text" xml:space="preserve">
<value>从剪贴板中导入规则</value>
</data>
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>92, 21</value>
</data>
<data name="toolStripMenuItem1.Text" xml:space="preserve">
<value>导入路由规则</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 25</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>785, 673</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>路由设置</value>
</data>

View File

@ -9,6 +9,9 @@ namespace v2rayN
public const string v2rayWebsiteUrl = @"https://www.v2fly.org/";
public const string AboutUrl = @"https://github.com/2dust/v2rayN";
public const string UpdateUrl = AboutUrl + @"/releases";
public const string v2flyCoreUrl = "https://github.com/v2fly/v2ray-core/releases";
public const string xrayCoreUrl = "https://github.com/XTLS/Xray-core/releases";
public const string NUrl = @"https://github.com/2dust/v2rayN/releases";
/// <summary>
@ -17,7 +20,7 @@ namespace v2rayN
public const string SpeedTestUrl = @"http://cachefly.cachefly.net/10mb.test";
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
public const string AvailabilityTestUrl = @"https://www.google.com/generate_204";
/// <summary>
/// CustomRoutingListUrl
/// </summary>

View File

@ -86,10 +86,10 @@ namespace v2rayN.Handler
if (Utils.IsNullOrEmpty(config.domainStrategy))
{
config.domainStrategy = "IPIfNonMatch";
}
if (config.routingItem == null)
}
if (config.rules == null)
{
config.routingItem = new List<RoutingItem>();
config.rules = new List<RulesItem>();
}
//kcp
if (config.kcpItem == null)
@ -1067,14 +1067,14 @@ namespace v2rayN.Handler
/// </summary>
/// <param name="config"></param>
/// <returns></returns>
public static int SaveRoutingItem(ref Config config)
public static int SaveRoutingRulesItem(ref Config config)
{
if (config.routingItem == null || config.routingItem.Count <= 0)
if (config.rules == null)
{
return -1;
}
foreach (RoutingItem sub in config.routingItem)
foreach (RulesItem sub in config.rules)
{
}
@ -1083,6 +1083,134 @@ namespace v2rayN.Handler
ToJsonFile(config);
return 0;
}
/// <summary>
/// AddRoutingRulesItem
/// </summary>
/// <param name="config"></param>
/// <param name="item"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int AddRoutingRule(ref Config config, RulesItem item, int index)
{
if (index >= 0)
{
config.rules[index] = item;
}
else
{
config.rules.Add(item);
}
Global.reloadV2ray = true;
ToJsonFile(config);
return 0;
}
/// <summary>
/// AddBatchRoutingRules
/// </summary>
/// <param name="config"></param>
/// <param name="clipboardData"></param>
/// <returns></returns>
public static int AddBatchRoutingRules(ref Config config, string clipboardData)
{
if (Utils.IsNullOrEmpty(clipboardData))
{
return -1;
}
var lstRules = Utils.FromJson<List<RulesItem>>(clipboardData);
if (lstRules == null)
{
return -1;
}
config.rules.Clear();
foreach (var item in lstRules)
{
config.rules.Add(item);
}
Global.reloadV2ray = true;
ToJsonFile(config);
return 0;
}
/// <summary>
/// MoveRoutingRule
/// </summary>
/// <param name="config"></param>
/// <param name="index"></param>
/// <param name="eMove"></param>
/// <returns></returns>
public static int MoveRoutingRule(ref Config config, int index, EMove eMove)
{
int count = config.rules.Count;
if (index < 0 || index > config.rules.Count - 1)
{
return -1;
}
switch (eMove)
{
case EMove.Top:
{
if (index == 0)
{
return 0;
}
var item = Utils.DeepCopy(config.rules[index]);
config.rules.RemoveAt(index);
config.rules.Insert(0, item);
break;
}
case EMove.Up:
{
if (index == 0)
{
return 0;
}
var item = Utils.DeepCopy(config.rules[index]);
config.rules.RemoveAt(index);
config.rules.Insert(index - 1, item);
break;
}
case EMove.Down:
{
if (index == count - 1)
{
return 0;
}
var item = Utils.DeepCopy(config.rules[index]);
config.rules.RemoveAt(index);
config.rules.Insert(index + 1, item);
break;
}
case EMove.Bottom:
{
if (index == count - 1)
{
return 0;
}
var item = Utils.DeepCopy(config.rules[index]);
config.rules.RemoveAt(index);
config.rules.Add(item);
break;
}
}
Global.reloadV2ray = true;
ToJsonFile(config);
return 0;
}
}
}

View File

@ -52,12 +52,12 @@ namespace v2rayN.Handler
#region Check for updates
private readonly string nLatestUrl = "https://github.com/2dust/v2rayN/releases/latest";
private const string nUrl = "https://github.com/2dust/v2rayN/releases/download/{0}/v2rayN.zip";
private readonly string v2flyCoreLatestUrl = "https://github.com/v2fly/v2ray-core/releases/latest";
private const string v2flyCoreUrl = "https://github.com/v2fly/v2ray-core/releases/download/{0}/v2ray-windows-{1}.zip";
private readonly string xrayCoreLatestUrl = "https://github.com/XTLS/Xray-core/releases/latest";
private const string xrayCoreUrl = "https://github.com/XTLS/Xray-core/releases/download/{0}/Xray-windows-{1}.zip";
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";
public async void CheckUpdateAsync(string type)
{
@ -119,7 +119,7 @@ namespace v2rayN.Handler
string filePath = Utils.GetPath(core);
if (!File.Exists(filePath))
{
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2fly/v2ray-core/releases");
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"");
//ShowMsg(true, msg);
return "";
}

View File

@ -195,9 +195,9 @@ namespace v2rayN.Handler
{
v2rayConfig.routing.domainStrategy = config.domainStrategy;
foreach (var item in config.routingItem)
foreach (var item in config.rules)
{
routingUserRule(item.userRules, item.outboundTag, ref v2rayConfig);
routingUserRule(item, ref v2rayConfig);
}
}
}
@ -206,68 +206,38 @@ namespace v2rayN.Handler
}
return 0;
}
private static int routingUserRule(List<string> userRule, string tag, ref V2rayConfig v2rayConfig)
private static int routingUserRule(RulesItem rules, ref V2rayConfig v2rayConfig)
{
try
{
if (userRule == null)
if (rules == null)
{
return 0;
}
else if (userRule.Count == 0)
var hasDomainIp = false;
if (rules.domain != null && rules.domain.Count > 0)
{
v2rayConfig.routing.rules.Add(new RulesItem
{
type = "field",
outboundTag = tag,
port = "0-65535"
});
var it = Utils.DeepCopy(rules);
it.ip = null;
it.type = "field";
v2rayConfig.routing.rules.Add(it);
hasDomainIp = true;
}
else if (userRule.Count > 0)
if (rules.ip != null && rules.ip.Count > 0)
{
//Domain
RulesItem rulesDomain = new RulesItem
{
type = "field",
outboundTag = tag,
domain = new List<string>()
};
//IP
RulesItem rulesIP = new RulesItem
{
type = "field",
outboundTag = tag,
ip = new List<string>()
};
foreach (string u in userRule)
{
string url = u.TrimEx();
if (Utils.IsNullOrEmpty(url))
{
continue;
}
if (Utils.IsIP(url) || url.StartsWith("geoip:"))
{
rulesIP.ip.Add(url);
}
else if (Utils.IsDomain(url)
|| url.StartsWith("geosite:")
|| url.StartsWith("regexp:")
|| url.StartsWith("domain:")
|| url.StartsWith("full:"))
{
rulesDomain.domain.Add(url);
}
}
if (rulesDomain.domain.Count > 0)
{
v2rayConfig.routing.rules.Add(rulesDomain);
}
if (rulesIP.ip.Count > 0)
{
v2rayConfig.routing.rules.Add(rulesIP);
}
var it = Utils.DeepCopy(rules);
it.domain = null;
it.type = "field";
v2rayConfig.routing.rules.Add(it);
hasDomainIp = true;
}
if (!hasDomainIp && !Utils.IsNullOrEmpty(rules.port))
{
var it = Utils.DeepCopy(rules);
it.domain = null;
it.ip = null;
it.type = "field";
v2rayConfig.routing.rules.Add(it);
}
}
catch

View File

@ -22,18 +22,13 @@ namespace v2rayN.Handler
{
private static string v2rayConfigRes = Global.v2rayConfigFileName;
private List<string> lstV2ray;
private string coreUrl;
public event ProcessDelegate ProcessEvent;
//private int processId = 0;
private Process _process;
public V2rayHandler()
{
lstV2ray = new List<string>
{
"xray",
"wv2ray",
"v2ray"
};
}
/// <summary>
@ -41,6 +36,24 @@ namespace v2rayN.Handler
/// </summary>
public void LoadV2ray(Config config)
{
if (config.coreType == ECoreType.v2fly_core)
{
lstV2ray = new List<string>
{
"wv2ray",
"v2ray"
};
coreUrl = Global.v2flyCoreUrl;
}
else
{
lstV2ray = new List<string>
{
"xray"
};
coreUrl = Global.xrayCoreUrl;
}
if (Global.reloadV2ray)
{
string fileName = Utils.GetPath(v2rayConfigRes);
@ -159,7 +172,8 @@ namespace v2rayN.Handler
}
}
private string V2rayFindexe() {
private string V2rayFindexe()
{
//查找v2ray文件是否存在
string fileName = string.Empty;
//lstV2ray.Reverse();
@ -175,7 +189,7 @@ namespace v2rayN.Handler
}
if (Utils.IsNullOrEmpty(fileName))
{
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2fly/v2ray-core/releases");
string msg = string.Format(UIRes.I18N("NotFoundCore"), coreUrl);
ShowMsg(false, msg);
}
return fileName;
@ -318,6 +332,6 @@ namespace v2rayN.Handler
{
Utils.SaveLog(ex.Message, ex);
}
}
}
}
}

View File

@ -74,7 +74,7 @@ namespace v2rayN.HttpProxyHandler
if (_process == null)
{
string privoxyConfig = Resources.privoxy_conf;
string privoxyConfig = "";//Resources.privoxy_conf;
RunningPort = config.GetLocalPort(Global.InboundHttp);
privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", localPort.ToString());
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", RunningPort.ToString());

View File

@ -96,7 +96,7 @@ namespace v2rayN.Mode
public string speedPingTestUrl
{
get; set;
}
}
/// <summary>
/// 允许来自局域网的连接
@ -161,7 +161,12 @@ namespace v2rayN.Mode
{
get; set;
}
public List<RoutingItem> routingItem
public List<RulesItem> rules
{
get; set;
}
public ECoreType coreType
{
get; set;
}
@ -276,7 +281,7 @@ namespace v2rayN.Mode
{
return GetLocalPort(Global.InboundSocks) + 1;
}
else if (protocol == "speedtest")
{
return GetLocalPort(Global.InboundSocks) + 103;
@ -693,32 +698,4 @@ namespace v2rayN.Mode
get; set;
}
}
[Serializable]
public class RoutingItem
{
/// <summary>
///
/// </summary>
public string remarks
{
get; set;
}
/// <summary>
///
/// </summary>
public string outboundTag
{
get; set;
}
/// <summary>
///
/// </summary>
public List<string> userRules
{
get; set;
}
}
}

View File

@ -3,7 +3,7 @@ namespace v2rayN.Mode
{
public enum ECoreType
{
v2fly_core = 1,
xray_core = 2
v2fly_core = 0,
Xray_core = 1
}
}

View File

@ -1,11 +0,0 @@

namespace v2rayN.Mode
{
public enum ERoutingSort
{
UserProxy = 1,
UserDirect = 2,
UserBlock = 3,
UserPredefined = 4
}
}

View File

@ -3,8 +3,8 @@ namespace v2rayN.Mode
{
public enum ESysProxyType
{
Unchanged = 0,
ForcedClear = 0,
ForcedChange = 1,
ForcedClear = 2
Unchanged = 2
}
}

View File

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
namespace v2rayN.Mode
{
[Serializable]
public class RulesItem
{
public string remarks { get; set; }
/// <summary>
///
/// </summary>
public string type { get; set; }
/// <summary>
///
/// </summary>
public string port { get; set; }
public List<string> inboundTag { get; set; }
/// <summary>
///
/// </summary>
public string outboundTag { get; set; }
/// <summary>
///
/// </summary>
public List<string> ip { get; set; }
/// <summary>
///
/// </summary>
public List<string> domain { get; set; }
}
}

View File

@ -323,34 +323,6 @@ namespace v2rayN.Mode
public List<string> servers { get; set; }
}
public class RulesItem
{
/// <summary>
///
/// </summary>
public string type { get; set; }
/// <summary>
///
/// </summary>
public string port { get; set; }
public List<string> inboundTag { get; set; }
/// <summary>
///
/// </summary>
public string outboundTag { get; set; }
/// <summary>
///
/// </summary>
public List<string> ip { get; set; }
/// <summary>
///
/// </summary>
public List<string> domain { get; set; }
}
public class Routing
{
/// <summary>

View File

@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
// 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("4.1")]
[assembly: AssemblyFileVersion("4.2")]

View File

@ -120,23 +120,6 @@ namespace v2rayN.Properties {
}
}
/// <summary>
/// 查找类似 listen-address __PRIVOXY_BIND_IP__:__PRIVOXY_BIND_PORT__
///toggle 0
///logfile v2ray_privoxy.log
///show-on-task-bar 0
///activity-animation 0
///forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
///max-client-connections 2048
///hide-console
/// 的本地化字符串。
/// </summary>
internal static string privoxy_conf {
get {
return ResourceManager.GetString("privoxy_conf", resourceCulture);
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>

View File

@ -151,9 +151,6 @@
<data name="sysproxy64_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\sysproxy64.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="privoxy_conf" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\privoxy_conf.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</value>
</data>
<data name="minimize" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
listen-address __PRIVOXY_BIND_IP__:__PRIVOXY_BIND_PORT__
toggle 0
logfile v2ray_privoxy.log
show-on-task-bar 0
activity-animation 0
forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
max-client-connections 2048
hide-console

View File

@ -19,7 +19,7 @@ namespace v2rayN.Resx {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class ResUI {
@ -627,6 +627,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Operation success 的本地化字符串。
/// </summary>
internal static string OperationSuccess {
get {
return ResourceManager.GetString("OperationSuccess", resourceCulture);
}
}
/// <summary>
/// 查找类似 Please Fill Remarks 的本地化字符串。
/// </summary>
@ -654,6 +663,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Please select rules 的本地化字符串。
/// </summary>
internal static string PleaseSelectRules {
get {
return ResourceManager.GetString("PleaseSelectRules", resourceCulture);
}
}
/// <summary>
/// 查找类似 Please select the server first 的本地化字符串。
/// </summary>
@ -681,6 +699,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Are you sure to remove the rules? 的本地化字符串。
/// </summary>
internal static string RemoveRules {
get {
return ResourceManager.GetString("RemoveRules", resourceCulture);
}
}
/// <summary>
/// 查找类似 Are you sure to remove the server? 的本地化字符串。
/// </summary>

View File

@ -361,4 +361,13 @@
<data name="TestMeOutput" xml:space="preserve">
<value>The ping of current service: {0}</value>
</data>
<data name="OperationSuccess" xml:space="preserve">
<value>Operation success</value>
</data>
<data name="PleaseSelectRules" xml:space="preserve">
<value>Please select rules</value>
</data>
<data name="RemoveRules" xml:space="preserve">
<value>Are you sure to remove the rules?</value>
</data>
</root>

View File

@ -361,4 +361,13 @@
<data name="TestMeOutput" xml:space="preserve">
<value>当前服务的真连接延迟: {0}</value>
</data>
<data name="OperationSuccess" xml:space="preserve">
<value>操作成功</value>
</data>
<data name="PleaseSelectRules" xml:space="preserve">
<value>请先选择规则</value>
</data>
<data name="RemoveRules" xml:space="preserve">
<value>是否确定移除规则?</value>
</data>
</root>

View File

@ -0,0 +1,28 @@
[{
"remarks": "block",
"outboundTag": "block",
"domain": [
"geosite:category-ads-all"
]
},
{
"remarks": "direct",
"outboundTag": "direct",
"domain": [
"geosite:cn"
]
},
{
"remarks": "direct",
"outboundTag": "direct",
"ip": [
"geoip:private",
"geoip:cn"
]
},
{
"remarks": "proxy",
"port": "0-65535",
"outboundTag": "proxy"
}
]

View File

@ -1,156 +0,0 @@
using System;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
namespace v2rayN
{
class CDateTime
{
/// <summary>
/// 设置本地系统时间
/// </summary>
public static void SetLocalTime()
{
using (WebClient wc = new WebClient())
{
string url = "";
string result = string.Empty;
try
{
wc.Encoding = Encoding.UTF8;
wc.DownloadStringCompleted += wc_DownloadStringCompleted;
wc.DownloadStringAsync(new Uri(url));
}
catch
{
}
}
}
static void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
try
{
string result = e.Result;
if (Utils.IsNullOrEmpty(result))
{
return;
}
EWebTime webTime = Utils.FromJson<EWebTime>(result);
if (webTime != null
&& webTime.result != null
&& webTime.result.stime != null
&& !Utils.IsNullOrEmpty(webTime.result.stime))
{
DateTime dtWeb = GetTimeFromLinux(webTime.result.stime);
SYSTEMTIME st = new SYSTEMTIME();
st.FromDateTime(dtWeb);
//调用Win32 API设置系统时间
Win32API.SetLocalTime(ref st);
}
}
catch
{
}
}
/// <summary>
/// 时间戳转为C#格式时间
/// </summary>
/// <param name="timeStamp"></param>
/// <returns></returns>
private static DateTime GetTimeFromLinux(string timeStamp)
{
DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
long lTime = long.Parse(timeStamp + "0000000");
TimeSpan toNow = new TimeSpan(lTime); return dtStart.Add(toNow);
}
}
/// <summary>
///
/// </summary>
public struct SYSTEMTIME
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
/// <summary>
/// 从System.DateTime转换。
/// </summary>
/// <param name="time">System.DateTime类型的时间。</param>
public void FromDateTime(DateTime time)
{
wYear = (ushort)time.Year;
wMonth = (ushort)time.Month;
wDayOfWeek = (ushort)time.DayOfWeek;
wDay = (ushort)time.Day;
wHour = (ushort)time.Hour;
wMinute = (ushort)time.Minute;
wSecond = (ushort)time.Second;
wMilliseconds = (ushort)time.Millisecond;
}
/// <summary>
/// 转换为System.DateTime类型。
/// </summary>
/// <returns></returns>
public DateTime ToDateTime()
{
return new DateTime(wYear, wMonth, wDay, wHour, wMinute, wSecond, wMilliseconds);
}
/// <summary>
/// 静态方法。转换为System.DateTime类型。
/// </summary>
/// <param name="time">SYSTEMTIME类型的时间。</param>
/// <returns></returns>
public static DateTime ToDateTime(SYSTEMTIME time)
{
return time.ToDateTime();
}
}
public class Win32API
{
[DllImport("Kernel32.dll")]
public static extern bool SetLocalTime(ref SYSTEMTIME Time);
[DllImport("Kernel32.dll")]
public static extern void GetLocalTime(ref SYSTEMTIME Time);
}
public class WTResult
{
/// <summary>
///
/// </summary>
public string stime { get; set; }
}
public class EWebTime
{
/// <summary>
///
/// </summary>
public WTResult result { get; set; }
/// <summary>
///
/// </summary>
public int error_code { get; set; }
/// <summary>
///
/// </summary>
public string reason { get; set; }
}
}

View File

@ -24,8 +24,7 @@ using Newtonsoft.Json.Linq;
namespace v2rayN
{
class Utils
{
{
#region 资源Json操作
@ -802,6 +801,10 @@ namespace v2rayN
}
}
public static void AddSubItem(ListViewItem i, string name, string text)
{
i.SubItems.Add(new ListViewItem.ListViewSubItem() { Name = name, Text = text });
}
#endregion
#region TempPath

View File

@ -125,6 +125,12 @@
<Compile Include="Forms\BaseServerForm.Designer.cs">
<DependentUpon>BaseServerForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\RoutingSettingDetailsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\RoutingSettingDetailsForm.Designer.cs">
<DependentUpon>RoutingSettingDetailsForm.cs</DependentUpon>
</Compile>
<Compile Include="Mode\ComboItem.cs" />
<Compile Include="Forms\MainForm.cs">
<SubType>Form</SubType>
@ -138,12 +144,6 @@
<Compile Include="Forms\RoutingSettingForm.Designer.cs">
<DependentUpon>RoutingSettingForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\RoutingSettingControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\RoutingSettingControl.Designer.cs">
<DependentUpon>RoutingSettingControl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\SubSettingForm.cs">
<SubType>Form</SubType>
</Compile>
@ -187,9 +187,9 @@
<Compile Include="HttpProxyHandler\SysProxyHandle.cs" />
<Compile Include="Mode\ECoreType.cs" />
<Compile Include="Mode\ESysProxyType.cs" />
<Compile Include="Mode\ERoutingSort.cs" />
<Compile Include="Mode\EMove.cs" />
<Compile Include="Mode\EServerColName.cs" />
<Compile Include="Mode\RulesItem.cs" />
<Compile Include="Mode\ServerStatistics.cs" />
<Compile Include="Mode\SysproxyConfig.cs" />
<Compile Include="Mode\EConfigType.cs" />
@ -300,12 +300,11 @@
<DependentUpon>QRCodeControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\RoutingSettingControl.resx">
<DependentUpon>RoutingSettingControl.cs</DependentUpon>
<SubType>Designer</SubType>
<EmbeddedResource Include="Forms\RoutingSettingDetailsForm.resx">
<DependentUpon>RoutingSettingDetailsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\RoutingSettingControl.zh-Hans.resx">
<DependentUpon>RoutingSettingControl.cs</DependentUpon>
<EmbeddedResource Include="Forms\RoutingSettingDetailsForm.zh-Hans.resx">
<DependentUpon>RoutingSettingDetailsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SubSettingControl.resx">
<DependentUpon>SubSettingControl.cs</DependentUpon>
@ -374,6 +373,7 @@
<None Include="Resources\sysproxy.exe.gz" />
<None Include="Resources\sysproxy64.exe.gz" />
<EmbeddedResource Include="Sample\custom_routing_private" />
<EmbeddedResource Include="Sample\custom_routing_rules" />
<Protobuf Include="Protos\Statistics.proto" />
</ItemGroup>
<ItemGroup>
@ -442,7 +442,6 @@
<None Include="Resources\about.png" />
<Content Include="Resources\help.png" />
<None Include="Resources\notify.png" />
<Content Include="Resources\privoxy_conf.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf">

View File

@ -9,7 +9,7 @@
<ErrorReportUrlHistory />
<FallbackCulture>zh-CN</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
<ProjectView>ProjectFiles</ProjectView>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>