Merge pull request #572 from yfdyh000/pr6

代码优化;测速进程出错回报;域名解析策略 文档链接
pull/582/head
2dust 2020-03-23 08:32:47 +08:00 committed by GitHub
commit 1510549663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 120 additions and 119 deletions

View File

@ -193,8 +193,12 @@ namespace v2rayN.Forms
VmessItem item = config.vmess[k]; VmessItem item = config.vmess[k];
ListViewItem lvItem = null; void _addSubItem(ListViewItem i, string name, string text)
if (statistics != null && statistics.Enable) {
i.SubItems.Add(new ListViewItem.ListViewSubItem() { Name = name, Text = text });
}
bool stats = statistics != null && statistics.Enable;
if (stats)
{ {
ServerStatItem sItem = statistics.Statistic.Find(item_ => item_.itemId == item.getItemId()); ServerStatItem sItem = statistics.Statistic.Find(item_ => item_.itemId == item.getItemId());
if (sItem != null) if (sItem != null)
@ -204,43 +208,27 @@ namespace v2rayN.Forms
todayUp = Utils.HumanFy(sItem.todayUp); todayUp = Utils.HumanFy(sItem.todayUp);
todayDown = Utils.HumanFy(sItem.todayDown); todayDown = Utils.HumanFy(sItem.todayDown);
} }
lvItem = new ListViewItem(new string[]
{
def,
((EConfigType)item.configType).ToString(),
item.remarks,
item.address,
item.port.ToString(),
//item.id,
//item.alterId.ToString(),
item.security,
item.network,
item.getSubRemarks(config),
item.testResult,
todayDown,
todayUp,
totalDown,
totalUp
});
} }
else ListViewItem lvItem = new ListViewItem();
_addSubItem(lvItem, "enabled", def);
_addSubItem(lvItem, "type", ((EConfigType)item.configType).ToString());
_addSubItem(lvItem, "remarks", item.remarks);
_addSubItem(lvItem, "address", item.address);
_addSubItem(lvItem, "port", item.port.ToString());
//_addSubItem(lvItem, "id", item.id);
//_addSubItem(lvItem, "alterId", item.alterId.ToString());
_addSubItem(lvItem, "security", item.security);
_addSubItem(lvItem, "network", item.network);
_addSubItem(lvItem, "SubRemarks", item.getSubRemarks(config));
_addSubItem(lvItem, "testResult", item.testResult);
if (stats)
{ {
lvItem = new ListViewItem(new string[] _addSubItem(lvItem, "todayDown", todayDown);
{ _addSubItem(lvItem, "todayUp", todayUp);
def, _addSubItem(lvItem, "totalDown", totalDown);
((EConfigType)item.configType).ToString(), _addSubItem(lvItem, "totalUp", totalUp);
item.remarks,
item.address,
item.port.ToString(),
//item.id,
//item.alterId.ToString(),
item.security,
item.network,
item.getSubRemarks(config),
item.testResult
});
} }
if (k % 2 == 1) // 隔行着色 if (k % 2 == 1) // 隔行着色
{ {
lvItem.BackColor = Color.WhiteSmoke; lvItem.BackColor = Color.WhiteSmoke;
@ -1021,7 +1009,7 @@ namespace v2rayN.Forms
private void SetTestResult(int k, string txt) private void SetTestResult(int k, string txt)
{ {
config.vmess[k].testResult = txt; config.vmess[k].testResult = txt;
lvServers.Items[k].SubItems[8].Text = txt; lvServers.Items[k].SubItems["testResult"].Text = txt;
} }
private void ClearTestResult() private void ClearTestResult()
{ {
@ -1060,11 +1048,10 @@ namespace v2rayN.Forms
{ {
lvServers.SuspendLayout(); lvServers.SuspendLayout();
int indexStart = 9; lvServers.Items[i].SubItems["todayDown"].Text = Utils.HumanFy(statistics[index].todayDown);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayDown); lvServers.Items[i].SubItems["todayUp"].Text = Utils.HumanFy(statistics[index].todayUp);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayUp); lvServers.Items[i].SubItems["totalDown"].Text = Utils.HumanFy(statistics[index].totalDown);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalDown); lvServers.Items[i].SubItems["totalUp"].Text = Utils.HumanFy(statistics[index].totalUp);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalUp);
lvServers.ResumeLayout(); lvServers.ResumeLayout();
}); });

View File

@ -65,10 +65,10 @@
this.tabPage8 = new System.Windows.Forms.TabPage(); this.tabPage8 = new System.Windows.Forms.TabPage();
this.cmbroutingMode = new System.Windows.Forms.ComboBox(); this.cmbroutingMode = new System.Windows.Forms.ComboBox();
this.panel3 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel();
this.linkLabelRoutingDoc = new System.Windows.Forms.LinkLabel();
this.btnSetDefRountingRule = new System.Windows.Forms.Button(); this.btnSetDefRountingRule = new System.Windows.Forms.Button();
this.labRoutingTips = new System.Windows.Forms.Label(); this.labRoutingTips = new System.Windows.Forms.Label();
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox(); this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
this.label15 = new System.Windows.Forms.Label();
this.tabPage6 = new System.Windows.Forms.TabPage(); this.tabPage6 = new System.Windows.Forms.TabPage();
this.chkKcpcongestion = new System.Windows.Forms.CheckBox(); this.chkKcpcongestion = new System.Windows.Forms.CheckBox();
this.txtKcpwriteBufferSize = new System.Windows.Forms.TextBox(); this.txtKcpwriteBufferSize = new System.Windows.Forms.TextBox();
@ -119,33 +119,32 @@
// //
// btnClose // btnClose
// //
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true; this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click); this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
// //
// tabControl1 // tabControl1
// //
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPage9); this.tabControl1.Controls.Add(this.tabPage9);
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0; this.tabControl1.SelectedIndex = 0;
// //
// tabPage1 // tabPage1
// //
resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Controls.Add(this.groupBox1); this.tabPage1.Controls.Add(this.groupBox1);
resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// groupBox1 // groupBox1
// //
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.label16); this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.cmblistenerType); this.groupBox1.Controls.Add(this.cmblistenerType);
this.groupBox1.Controls.Add(this.chksniffingEnabled2); this.groupBox1.Controls.Add(this.chksniffingEnabled2);
@ -166,6 +165,7 @@
this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtlocalPort); this.groupBox1.Controls.Add(this.txtlocalPort);
this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label2);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
@ -176,7 +176,6 @@
// //
// cmblistenerType // cmblistenerType
// //
resources.ApplyResources(this.cmblistenerType, "cmblistenerType");
this.cmblistenerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmblistenerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmblistenerType.FormattingEnabled = true; this.cmblistenerType.FormattingEnabled = true;
this.cmblistenerType.Items.AddRange(new object[] { this.cmblistenerType.Items.AddRange(new object[] {
@ -187,6 +186,7 @@
resources.GetString("cmblistenerType.Items4"), resources.GetString("cmblistenerType.Items4"),
resources.GetString("cmblistenerType.Items5"), resources.GetString("cmblistenerType.Items5"),
resources.GetString("cmblistenerType.Items6")}); resources.GetString("cmblistenerType.Items6")});
resources.ApplyResources(this.cmblistenerType, "cmblistenerType");
this.cmblistenerType.Name = "cmblistenerType"; this.cmblistenerType.Name = "cmblistenerType";
// //
// chksniffingEnabled2 // chksniffingEnabled2
@ -232,12 +232,12 @@
// //
// cmbprotocol2 // cmbprotocol2
// //
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbprotocol2.FormattingEnabled = true; this.cmbprotocol2.FormattingEnabled = true;
this.cmbprotocol2.Items.AddRange(new object[] { this.cmbprotocol2.Items.AddRange(new object[] {
resources.GetString("cmbprotocol2.Items"), resources.GetString("cmbprotocol2.Items"),
resources.GetString("cmbprotocol2.Items1")}); resources.GetString("cmbprotocol2.Items1")});
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
this.cmbprotocol2.Name = "cmbprotocol2"; this.cmbprotocol2.Name = "cmbprotocol2";
// //
// label3 // label3
@ -252,8 +252,8 @@
// //
// cmbprotocol // cmbprotocol
// //
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.FormattingEnabled = true; this.cmbprotocol.FormattingEnabled = true;
this.cmbprotocol.Items.AddRange(new object[] { this.cmbprotocol.Items.AddRange(new object[] {
resources.GetString("cmbprotocol.Items"), resources.GetString("cmbprotocol.Items"),
@ -279,7 +279,6 @@
// //
// cmbloglevel // cmbloglevel
// //
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbloglevel.FormattingEnabled = true; this.cmbloglevel.FormattingEnabled = true;
this.cmbloglevel.Items.AddRange(new object[] { this.cmbloglevel.Items.AddRange(new object[] {
@ -288,6 +287,7 @@
resources.GetString("cmbloglevel.Items2"), resources.GetString("cmbloglevel.Items2"),
resources.GetString("cmbloglevel.Items3"), resources.GetString("cmbloglevel.Items3"),
resources.GetString("cmbloglevel.Items4")}); resources.GetString("cmbloglevel.Items4")});
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.Name = "cmbloglevel"; this.cmbloglevel.Name = "cmbloglevel";
// //
// label5 // label5
@ -307,33 +307,33 @@
// //
// tabPage2 // tabPage2
// //
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Controls.Add(this.groupBox2); this.tabPage2.Controls.Add(this.groupBox2);
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Name = "tabPage2"; this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.UseVisualStyleBackColor = true;
// //
// groupBox2 // groupBox2
// //
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.tabControl2); this.groupBox2.Controls.Add(this.tabControl2);
this.groupBox2.Controls.Add(this.panel3); this.groupBox2.Controls.Add(this.panel3);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
// //
// tabControl2 // tabControl2
// //
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Controls.Add(this.tabPage3); this.tabControl2.Controls.Add(this.tabPage3);
this.tabControl2.Controls.Add(this.tabPage4); this.tabControl2.Controls.Add(this.tabPage4);
this.tabControl2.Controls.Add(this.tabPage5); this.tabControl2.Controls.Add(this.tabPage5);
this.tabControl2.Controls.Add(this.tabPage8); this.tabControl2.Controls.Add(this.tabPage8);
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Name = "tabControl2"; this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0; this.tabControl2.SelectedIndex = 0;
// //
// tabPage3 // tabPage3
// //
resources.ApplyResources(this.tabPage3, "tabPage3");
this.tabPage3.Controls.Add(this.txtUseragent); this.tabPage3.Controls.Add(this.txtUseragent);
resources.ApplyResources(this.tabPage3, "tabPage3");
this.tabPage3.Name = "tabPage3"; this.tabPage3.Name = "tabPage3";
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage3.UseVisualStyleBackColor = true;
// //
@ -344,8 +344,8 @@
// //
// tabPage4 // tabPage4
// //
resources.ApplyResources(this.tabPage4, "tabPage4");
this.tabPage4.Controls.Add(this.txtUserdirect); this.tabPage4.Controls.Add(this.txtUserdirect);
resources.ApplyResources(this.tabPage4, "tabPage4");
this.tabPage4.Name = "tabPage4"; this.tabPage4.Name = "tabPage4";
this.tabPage4.UseVisualStyleBackColor = true; this.tabPage4.UseVisualStyleBackColor = true;
// //
@ -356,8 +356,8 @@
// //
// tabPage5 // tabPage5
// //
resources.ApplyResources(this.tabPage5, "tabPage5");
this.tabPage5.Controls.Add(this.txtUserblock); this.tabPage5.Controls.Add(this.txtUserblock);
resources.ApplyResources(this.tabPage5, "tabPage5");
this.tabPage5.Name = "tabPage5"; this.tabPage5.Name = "tabPage5";
this.tabPage5.UseVisualStyleBackColor = true; this.tabPage5.UseVisualStyleBackColor = true;
// //
@ -368,14 +368,13 @@
// //
// tabPage8 // tabPage8
// //
resources.ApplyResources(this.tabPage8, "tabPage8");
this.tabPage8.Controls.Add(this.cmbroutingMode); this.tabPage8.Controls.Add(this.cmbroutingMode);
resources.ApplyResources(this.tabPage8, "tabPage8");
this.tabPage8.Name = "tabPage8"; this.tabPage8.Name = "tabPage8";
this.tabPage8.UseVisualStyleBackColor = true; this.tabPage8.UseVisualStyleBackColor = true;
// //
// cmbroutingMode // cmbroutingMode
// //
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbroutingMode.FormattingEnabled = true; this.cmbroutingMode.FormattingEnabled = true;
this.cmbroutingMode.Items.AddRange(new object[] { this.cmbroutingMode.Items.AddRange(new object[] {
@ -383,17 +382,25 @@
resources.GetString("cmbroutingMode.Items1"), resources.GetString("cmbroutingMode.Items1"),
resources.GetString("cmbroutingMode.Items2"), resources.GetString("cmbroutingMode.Items2"),
resources.GetString("cmbroutingMode.Items3")}); resources.GetString("cmbroutingMode.Items3")});
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
this.cmbroutingMode.Name = "cmbroutingMode"; this.cmbroutingMode.Name = "cmbroutingMode";
// //
// panel3 // panel3
// //
resources.ApplyResources(this.panel3, "panel3"); this.panel3.Controls.Add(this.linkLabelRoutingDoc);
this.panel3.Controls.Add(this.btnSetDefRountingRule); this.panel3.Controls.Add(this.btnSetDefRountingRule);
this.panel3.Controls.Add(this.labRoutingTips); this.panel3.Controls.Add(this.labRoutingTips);
this.panel3.Controls.Add(this.cmbdomainStrategy); this.panel3.Controls.Add(this.cmbdomainStrategy);
this.panel3.Controls.Add(this.label15); resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3"; this.panel3.Name = "panel3";
// //
// linkLabelRoutingDoc
//
resources.ApplyResources(this.linkLabelRoutingDoc, "linkLabelRoutingDoc");
this.linkLabelRoutingDoc.Name = "linkLabelRoutingDoc";
this.linkLabelRoutingDoc.TabStop = true;
this.linkLabelRoutingDoc.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelRoutingDoc_LinkClicked);
//
// btnSetDefRountingRule // btnSetDefRountingRule
// //
resources.ApplyResources(this.btnSetDefRountingRule, "btnSetDefRountingRule"); resources.ApplyResources(this.btnSetDefRountingRule, "btnSetDefRountingRule");
@ -403,29 +410,23 @@
// //
// labRoutingTips // labRoutingTips
// //
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown; this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips"; this.labRoutingTips.Name = "labRoutingTips";
// //
// cmbdomainStrategy // cmbdomainStrategy
// //
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainStrategy.FormattingEnabled = true; this.cmbdomainStrategy.FormattingEnabled = true;
this.cmbdomainStrategy.Items.AddRange(new object[] { this.cmbdomainStrategy.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy.Items"), resources.GetString("cmbdomainStrategy.Items"),
resources.GetString("cmbdomainStrategy.Items1"), resources.GetString("cmbdomainStrategy.Items1"),
resources.GetString("cmbdomainStrategy.Items2")}); resources.GetString("cmbdomainStrategy.Items2")});
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.Name = "cmbdomainStrategy"; this.cmbdomainStrategy.Name = "cmbdomainStrategy";
// //
// label15
//
resources.ApplyResources(this.label15, "label15");
this.label15.Name = "label15";
//
// tabPage6 // tabPage6
// //
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Controls.Add(this.chkKcpcongestion); this.tabPage6.Controls.Add(this.chkKcpcongestion);
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize); this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
this.tabPage6.Controls.Add(this.label10); this.tabPage6.Controls.Add(this.label10);
@ -439,6 +440,7 @@
this.tabPage6.Controls.Add(this.label7); this.tabPage6.Controls.Add(this.label7);
this.tabPage6.Controls.Add(this.txtKcpmtu); this.tabPage6.Controls.Add(this.txtKcpmtu);
this.tabPage6.Controls.Add(this.label6); this.tabPage6.Controls.Add(this.label6);
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Name = "tabPage6"; this.tabPage6.Name = "tabPage6";
this.tabPage6.UseVisualStyleBackColor = true; this.tabPage6.UseVisualStyleBackColor = true;
// //
@ -510,7 +512,6 @@
// //
// tabPage7 // tabPage7
// //
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Controls.Add(this.chkKeepOlderDedupl); this.tabPage7.Controls.Add(this.chkKeepOlderDedupl);
this.tabPage7.Controls.Add(this.cbFreshrate); this.tabPage7.Controls.Add(this.cbFreshrate);
this.tabPage7.Controls.Add(this.lbFreshrate); this.tabPage7.Controls.Add(this.lbFreshrate);
@ -519,6 +520,7 @@
this.tabPage7.Controls.Add(this.txturlGFWList); this.tabPage7.Controls.Add(this.txturlGFWList);
this.tabPage7.Controls.Add(this.label13); this.tabPage7.Controls.Add(this.label13);
this.tabPage7.Controls.Add(this.chkAutoRun); this.tabPage7.Controls.Add(this.chkAutoRun);
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Name = "tabPage7"; this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true; this.tabPage7.UseVisualStyleBackColor = true;
// //
@ -530,9 +532,9 @@
// //
// cbFreshrate // cbFreshrate
// //
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbFreshrate.FormattingEnabled = true; this.cbFreshrate.FormattingEnabled = true;
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.Name = "cbFreshrate"; this.cbFreshrate.Name = "cbFreshrate";
// //
// lbFreshrate // lbFreshrate
@ -570,9 +572,9 @@
// //
// tabPage9 // tabPage9
// //
resources.ApplyResources(this.tabPage9, "tabPage9");
this.tabPage9.Controls.Add(this.txtuserPacRule); this.tabPage9.Controls.Add(this.txtuserPacRule);
this.tabPage9.Controls.Add(this.panel4); this.tabPage9.Controls.Add(this.panel4);
resources.ApplyResources(this.tabPage9, "tabPage9");
this.tabPage9.Name = "tabPage9"; this.tabPage9.Name = "tabPage9";
this.tabPage9.UseVisualStyleBackColor = true; this.tabPage9.UseVisualStyleBackColor = true;
// //
@ -583,21 +585,21 @@
// //
// panel4 // panel4
// //
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.label4); this.panel4.Controls.Add(this.label4);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4"; this.panel4.Name = "panel4";
// //
// label4 // label4
// //
resources.ApplyResources(this.label4, "label4");
this.label4.ForeColor = System.Drawing.Color.Brown; this.label4.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4"; this.label4.Name = "label4";
// //
// panel2 // panel2
// //
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose); this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK); this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
// //
// btnOK // btnOK
@ -707,7 +709,6 @@
private System.Windows.Forms.Label label14; private System.Windows.Forms.Label label14;
private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.ComboBox cmbdomainStrategy; private System.Windows.Forms.ComboBox cmbdomainStrategy;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.ComboBox cmbroutingMode; private System.Windows.Forms.ComboBox cmbroutingMode;
private System.Windows.Forms.CheckBox chksniffingEnabled; private System.Windows.Forms.CheckBox chksniffingEnabled;
private System.Windows.Forms.CheckBox chksniffingEnabled2; private System.Windows.Forms.CheckBox chksniffingEnabled2;
@ -723,5 +724,6 @@
private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox chkKeepOlderDedupl; private System.Windows.Forms.CheckBox chkKeepOlderDedupl;
private System.Windows.Forms.LinkLabel linkLabelRoutingDoc;
} }
} }

View File

@ -437,6 +437,11 @@ namespace v2rayN.Forms
{ {
labRoutingTips.Text = text; labRoutingTips.Text = text;
} }
private void linkLabelRoutingDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://www.v2ray.com/chapter_02/03_routing.html#routingobject");
}
} }
class ComboItem class ComboItem

View File

@ -117,8 +117,8 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing"> <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value> <value>6, 12</value>
@ -159,6 +159,12 @@
<data name="btnOK.Text" xml:space="preserve"> <data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value> <value>&amp;OK</value>
</data> </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.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
<value>322, 10</value> <value>322, 10</value>
</data> </data>
@ -220,7 +226,7 @@
<value>15, 16</value> <value>15, 16</value>
</data> </data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>132, 16</value> <value>246, 16</value>
</data> </data>
<data name="chkAutoRun.TabIndex" type="System.Int32, mscorlib"> <data name="chkAutoRun.TabIndex" type="System.Int32, mscorlib">
<value>23</value> <value>23</value>
@ -238,7 +244,7 @@
<value>15, 62</value> <value>15, 62</value>
</data> </data>
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>558, 16</value> <value>576, 16</value>
</data> </data>
<data name="chkEnableStatistics.TabIndex" type="System.Int32, mscorlib"> <data name="chkEnableStatistics.TabIndex" type="System.Int32, mscorlib">
<value>29</value> <value>29</value>
@ -609,24 +615,6 @@
<data name="label14.Text" xml:space="preserve"> <data name="label14.Text" xml:space="preserve">
<value>Custom DNS (multiple, separated by commas (,))</value> <value>Custom DNS (multiple, separated by commas (,))</value>
</data> </data>
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label15.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 14</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="label15.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>Domain strategy</value>
</data>
<data name="label16.AutoSize" type="System.Boolean, mscorlib"> <data name="label16.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
@ -798,6 +786,24 @@
<data name="lbFreshrate.Text" xml:space="preserve"> <data name="lbFreshrate.Text" xml:space="preserve">
<value>Statistics freshrate</value> <value>Statistics freshrate</value>
</data> </data>
<data name="linkLabelRoutingDoc.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="linkLabelRoutingDoc.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 14</value>
</data>
<data name="linkLabelRoutingDoc.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>
<data name="linkLabelRoutingDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="linkLabelRoutingDoc.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
</data>
<data name="linkLabelRoutingDoc.Text" xml:space="preserve">
<value>Domain strategy</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value> <value>Top</value>
</data> </data>

View File

@ -117,9 +117,6 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.Text" xml:space="preserve"> <data name="$this.Text" xml:space="preserve">
<value>参数设置</value> <value>参数设置</value>
</data> </data>
@ -129,9 +126,11 @@
<data name="btnOK.Text" xml:space="preserve"> <data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value> <value>确定(&amp;O)</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnSetDefRountingRule.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="btnSetDefRountingRule.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
<value>351, 14</value> <value>351, 14</value>
</data> </data>
@ -201,12 +200,6 @@
<data name="chkudpEnabled2.Text" xml:space="preserve"> <data name="chkudpEnabled2.Text" xml:space="preserve">
<value>开启UDP</value> <value>开启UDP</value>
</data> </data>
<data name="cmbdomainStrategy.Location" type="System.Drawing.Point, System.Drawing">
<value>81, 14</value>
</data>
<data name="cmbdomainStrategy.Size" type="System.Drawing.Size, System.Drawing">
<value>186, 20</value>
</data>
<data name="cmblistenerType.Items" xml:space="preserve"> <data name="cmblistenerType.Items" xml:space="preserve">
<value>关闭Http代理</value> <value>关闭Http代理</value>
</data> </data>
@ -267,9 +260,6 @@
<data name="label15.Size" type="System.Drawing.Size, System.Drawing"> <data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value> <value>53, 12</value>
</data> </data>
<data name="label15.Text" xml:space="preserve">
<value>域名策略</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing"> <data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value> <value>53, 12</value>
</data> </data>
@ -297,6 +287,7 @@
<data name="label5.Text" xml:space="preserve"> <data name="label5.Text" xml:space="preserve">
<value>日志等级</value> <value>日志等级</value>
</data> </data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib"> <data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
@ -315,6 +306,9 @@
<data name="lbFreshrate.Text" xml:space="preserve"> <data name="lbFreshrate.Text" xml:space="preserve">
<value>统计刷新频率</value> <value>统计刷新频率</value>
</data> </data>
<data name="linkLabelRoutingDoc.Text" xml:space="preserve">
<value>域名解析策略</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing"> <data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 72</value> <value>642, 72</value>
</data> </data>

View File

@ -109,17 +109,14 @@ namespace v2rayN.Handler
//Thread.Sleep(5000); //Thread.Sleep(5000);
int httpPort = _config.GetLocalPort("speedtest"); int httpPort = _config.GetLocalPort("speedtest");
Task[] tasks = new Task[_selecteds.Count]; List<Task> tasks = new List<Task>();
int i = -1;
foreach (int itemIndex in _selecteds) foreach (int itemIndex in _selecteds)
{ {
if (_config.vmess[itemIndex].configType == (int)EConfigType.Custom) if (_config.vmess[itemIndex].configType == (int)EConfigType.Custom)
{ {
continue; continue;
} }
tasks.Add(Task.Run(() =>
i++;
tasks[i] = Task.Run(() =>
{ {
try try
{ {
@ -133,12 +130,10 @@ namespace v2rayN.Handler
{ {
Utils.SaveLog(ex.Message, ex); Utils.SaveLog(ex.Message, ex);
} }
}); }));
//Thread.Sleep(100); //Thread.Sleep(100);
} }
Task.WaitAll(tasks); Task.WaitAll(tasks.ToArray());
Thread.Sleep(100);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -200,6 +200,7 @@ namespace v2rayN.Handler
WorkingDirectory = Utils.StartupPath(), WorkingDirectory = Utils.StartupPath(),
UseShellExecute = false, UseShellExecute = false,
RedirectStandardOutput = true, RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true, CreateNoWindow = true,
StandardOutputEncoding = Encoding.UTF8 StandardOutputEncoding = Encoding.UTF8
} }
@ -217,6 +218,11 @@ namespace v2rayN.Handler
//processId = p.Id; //processId = p.Id;
_process = p; _process = p;
if (p.WaitForExit(1000))
{
throw new Exception(p.StandardError.ReadToEnd());
}
Global.processJob.AddProcess(p.Handle); Global.processJob.AddProcess(p.Handle);
} }
catch (Exception ex) catch (Exception ex)
@ -248,6 +254,7 @@ namespace v2rayN.Handler
UseShellExecute = false, UseShellExecute = false,
RedirectStandardInput = true, RedirectStandardInput = true,
RedirectStandardOutput = true, RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true, CreateNoWindow = true,
StandardOutputEncoding = Encoding.UTF8 StandardOutputEncoding = Encoding.UTF8
} }
@ -266,6 +273,11 @@ namespace v2rayN.Handler
p.StandardInput.Write(configStr); p.StandardInput.Write(configStr);
p.StandardInput.Close(); p.StandardInput.Close();
if (p.WaitForExit(1000))
{
throw new Exception(p.StandardError.ReadToEnd());
}
Global.processJob.AddProcess(p.Handle); Global.processJob.AddProcess(p.Handle);
return p.Id; return p.Id;
} }
@ -273,7 +285,7 @@ namespace v2rayN.Handler
{ {
Utils.SaveLog(ex.Message, ex); Utils.SaveLog(ex.Message, ex);
string msg = ex.Message; string msg = ex.Message;
ShowMsg(true, msg); ShowMsg(false, msg);
return -1; return -1;
} }
} }