Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f3fbdfe17 | ||
|
|
3be93df63f | ||
|
|
6259539c87 | ||
|
|
9654009650 | ||
|
|
62e796cf5a | ||
|
|
af820bb0f2 | ||
|
|
8f5bb3591b | ||
|
|
7eafae98d4 | ||
|
|
1d4e5baafb |
@@ -162,7 +162,7 @@ namespace v2rayN.Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task DownloadDataAsync4Speed(HttpClient client, string url, IProgress<double> progress, CancellationToken token)
|
public async Task DownloadDataAsync4Speed(HttpClient client, string url, IProgress<string> progress, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(url))
|
if (string.IsNullOrEmpty(url))
|
||||||
{
|
{
|
||||||
@@ -176,15 +176,15 @@ namespace v2rayN.Base
|
|||||||
throw new Exception(string.Format("The request returned with HTTP status code {0}", response.StatusCode));
|
throw new Exception(string.Format("The request returned with HTTP status code {0}", response.StatusCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
var total = response.Content.Headers.ContentLength.HasValue ? response.Content.Headers.ContentLength.Value : -1L;
|
//var total = response.Content.Headers.ContentLength.HasValue ? response.Content.Headers.ContentLength.Value : -1L;
|
||||||
var canReportProgress = total != -1 && progress != null;
|
//var canReportProgress = total != -1 && progress != null;
|
||||||
|
|
||||||
using (var stream = await response.Content.ReadAsStreamAsync())
|
using (var stream = await response.Content.ReadAsStreamAsync())
|
||||||
{
|
{
|
||||||
var totalRead = 0L;
|
var totalRead = 0L;
|
||||||
var buffer = new byte[1024 * 64];
|
var buffer = new byte[1024 * 64];
|
||||||
var isMoreToRead = true;
|
var isMoreToRead = true;
|
||||||
var progressPercentage = 0;
|
string progressSpeed = string.Empty;
|
||||||
DateTime totalDatetime = DateTime.Now;
|
DateTime totalDatetime = DateTime.Now;
|
||||||
|
|
||||||
do
|
do
|
||||||
@@ -215,14 +215,13 @@ namespace v2rayN.Base
|
|||||||
// TODO:
|
// TODO:
|
||||||
totalRead += read;
|
totalRead += read;
|
||||||
|
|
||||||
if (canReportProgress)
|
|
||||||
{
|
|
||||||
TimeSpan ts = (DateTime.Now - totalDatetime);
|
TimeSpan ts = (DateTime.Now - totalDatetime);
|
||||||
var speed = totalRead * 1d / ts.TotalMilliseconds / 1000;
|
var speed = (totalRead * 1d / ts.TotalMilliseconds / 1000).ToString("#0.0");
|
||||||
var percent = Convert.ToInt32((totalRead * 1d) / (total * 1d) * 100);
|
if (progress != null)
|
||||||
if (progressPercentage != percent)
|
|
||||||
{
|
{
|
||||||
progressPercentage = percent;
|
if (progressSpeed != speed)
|
||||||
|
{
|
||||||
|
progressSpeed = speed;
|
||||||
progress.Report(speed);
|
progress.Report(speed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ namespace v2rayN.Forms
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
address = Path.Combine(Utils.GetConfigPath(), address);
|
address = Utils.GetConfigPath(address);
|
||||||
Process.Start(address);
|
Process.Start(address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -375,9 +375,6 @@
|
|||||||
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>131, 18</value>
|
<value>131, 18</value>
|
||||||
</metadata>
|
</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">
|
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|||||||
49
v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs
generated
49
v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs
generated
@@ -104,6 +104,7 @@
|
|||||||
this.panel2 = new System.Windows.Forms.Panel();
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
this.btnOK = new System.Windows.Forms.Button();
|
this.btnOK = new System.Windows.Forms.Button();
|
||||||
this.panel1 = new System.Windows.Forms.Panel();
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
|
this.chkEnableSystemProxyAdvanced = new System.Windows.Forms.CheckBox();
|
||||||
this.tabControl1.SuspendLayout();
|
this.tabControl1.SuspendLayout();
|
||||||
this.tabPage1.SuspendLayout();
|
this.tabPage1.SuspendLayout();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
@@ -118,34 +119,33 @@
|
|||||||
//
|
//
|
||||||
// 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.tabPageCoreType);
|
this.tabControl1.Controls.Add(this.tabPageCoreType);
|
||||||
this.tabControl1.Controls.Add(this.tabPage3);
|
this.tabControl1.Controls.Add(this.tabPage3);
|
||||||
|
resources.ApplyResources(this.tabControl1, "tabControl1");
|
||||||
this.tabControl1.Name = "tabControl1";
|
this.tabControl1.Name = "tabControl1";
|
||||||
this.tabControl1.SelectedIndex = 0;
|
this.tabControl1.SelectedIndex = 0;
|
||||||
//
|
//
|
||||||
// tabPage1
|
// tabPage1
|
||||||
//
|
//
|
||||||
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.label4);
|
this.groupBox1.Controls.Add(this.label4);
|
||||||
this.groupBox1.Controls.Add(this.txtpass);
|
this.groupBox1.Controls.Add(this.txtpass);
|
||||||
@@ -162,6 +162,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;
|
||||||
//
|
//
|
||||||
@@ -211,8 +212,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"),
|
||||||
@@ -238,7 +239,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[] {
|
||||||
@@ -247,6 +247,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
|
||||||
@@ -266,10 +267,10 @@
|
|||||||
//
|
//
|
||||||
// tabPage2
|
// tabPage2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage2, "tabPage2");
|
|
||||||
this.tabPage2.Controls.Add(this.linkDnsObjectDoc);
|
this.tabPage2.Controls.Add(this.linkDnsObjectDoc);
|
||||||
this.tabPage2.Controls.Add(this.txtremoteDNS);
|
this.tabPage2.Controls.Add(this.txtremoteDNS);
|
||||||
this.tabPage2.Controls.Add(this.label14);
|
this.tabPage2.Controls.Add(this.label14);
|
||||||
|
resources.ApplyResources(this.tabPage2, "tabPage2");
|
||||||
this.tabPage2.Name = "tabPage2";
|
this.tabPage2.Name = "tabPage2";
|
||||||
this.tabPage2.UseVisualStyleBackColor = true;
|
this.tabPage2.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
@@ -292,7 +293,6 @@
|
|||||||
//
|
//
|
||||||
// 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);
|
||||||
@@ -306,6 +306,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;
|
||||||
//
|
//
|
||||||
@@ -377,7 +378,6 @@
|
|||||||
//
|
//
|
||||||
// tabPage7
|
// tabPage7
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage7, "tabPage7");
|
|
||||||
this.tabPage7.Controls.Add(this.txttrayMenuServersLimit);
|
this.tabPage7.Controls.Add(this.txttrayMenuServersLimit);
|
||||||
this.tabPage7.Controls.Add(this.label17);
|
this.tabPage7.Controls.Add(this.label17);
|
||||||
this.tabPage7.Controls.Add(this.txtautoUpdateSubInterval);
|
this.tabPage7.Controls.Add(this.txtautoUpdateSubInterval);
|
||||||
@@ -393,6 +393,7 @@
|
|||||||
this.tabPage7.Controls.Add(this.lbFreshrate);
|
this.tabPage7.Controls.Add(this.lbFreshrate);
|
||||||
this.tabPage7.Controls.Add(this.chkEnableStatistics);
|
this.tabPage7.Controls.Add(this.chkEnableStatistics);
|
||||||
this.tabPage7.Controls.Add(this.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;
|
||||||
//
|
//
|
||||||
@@ -459,9 +460,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
|
||||||
@@ -483,7 +484,6 @@
|
|||||||
//
|
//
|
||||||
// tabPageCoreType
|
// tabPageCoreType
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
|
|
||||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType6);
|
this.tabPageCoreType.Controls.Add(this.cmbCoreType6);
|
||||||
this.tabPageCoreType.Controls.Add(this.labCoreType6);
|
this.tabPageCoreType.Controls.Add(this.labCoreType6);
|
||||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType5);
|
this.tabPageCoreType.Controls.Add(this.cmbCoreType5);
|
||||||
@@ -496,14 +496,15 @@
|
|||||||
this.tabPageCoreType.Controls.Add(this.labCoreType2);
|
this.tabPageCoreType.Controls.Add(this.labCoreType2);
|
||||||
this.tabPageCoreType.Controls.Add(this.cmbCoreType1);
|
this.tabPageCoreType.Controls.Add(this.cmbCoreType1);
|
||||||
this.tabPageCoreType.Controls.Add(this.labCoreType1);
|
this.tabPageCoreType.Controls.Add(this.labCoreType1);
|
||||||
|
resources.ApplyResources(this.tabPageCoreType, "tabPageCoreType");
|
||||||
this.tabPageCoreType.Name = "tabPageCoreType";
|
this.tabPageCoreType.Name = "tabPageCoreType";
|
||||||
this.tabPageCoreType.UseVisualStyleBackColor = true;
|
this.tabPageCoreType.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// cmbCoreType6
|
// cmbCoreType6
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
|
|
||||||
this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbCoreType6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbCoreType6.FormattingEnabled = true;
|
this.cmbCoreType6.FormattingEnabled = true;
|
||||||
|
resources.ApplyResources(this.cmbCoreType6, "cmbCoreType6");
|
||||||
this.cmbCoreType6.Name = "cmbCoreType6";
|
this.cmbCoreType6.Name = "cmbCoreType6";
|
||||||
//
|
//
|
||||||
// labCoreType6
|
// labCoreType6
|
||||||
@@ -513,9 +514,9 @@
|
|||||||
//
|
//
|
||||||
// cmbCoreType5
|
// cmbCoreType5
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
|
|
||||||
this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbCoreType5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbCoreType5.FormattingEnabled = true;
|
this.cmbCoreType5.FormattingEnabled = true;
|
||||||
|
resources.ApplyResources(this.cmbCoreType5, "cmbCoreType5");
|
||||||
this.cmbCoreType5.Name = "cmbCoreType5";
|
this.cmbCoreType5.Name = "cmbCoreType5";
|
||||||
//
|
//
|
||||||
// labCoreType5
|
// labCoreType5
|
||||||
@@ -525,9 +526,9 @@
|
|||||||
//
|
//
|
||||||
// cmbCoreType4
|
// cmbCoreType4
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
|
|
||||||
this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbCoreType4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbCoreType4.FormattingEnabled = true;
|
this.cmbCoreType4.FormattingEnabled = true;
|
||||||
|
resources.ApplyResources(this.cmbCoreType4, "cmbCoreType4");
|
||||||
this.cmbCoreType4.Name = "cmbCoreType4";
|
this.cmbCoreType4.Name = "cmbCoreType4";
|
||||||
//
|
//
|
||||||
// labCoreType4
|
// labCoreType4
|
||||||
@@ -537,9 +538,9 @@
|
|||||||
//
|
//
|
||||||
// cmbCoreType3
|
// cmbCoreType3
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
|
|
||||||
this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbCoreType3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbCoreType3.FormattingEnabled = true;
|
this.cmbCoreType3.FormattingEnabled = true;
|
||||||
|
resources.ApplyResources(this.cmbCoreType3, "cmbCoreType3");
|
||||||
this.cmbCoreType3.Name = "cmbCoreType3";
|
this.cmbCoreType3.Name = "cmbCoreType3";
|
||||||
//
|
//
|
||||||
// labCoreType3
|
// labCoreType3
|
||||||
@@ -549,9 +550,9 @@
|
|||||||
//
|
//
|
||||||
// cmbCoreType2
|
// cmbCoreType2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
|
|
||||||
this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbCoreType2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbCoreType2.FormattingEnabled = true;
|
this.cmbCoreType2.FormattingEnabled = true;
|
||||||
|
resources.ApplyResources(this.cmbCoreType2, "cmbCoreType2");
|
||||||
this.cmbCoreType2.Name = "cmbCoreType2";
|
this.cmbCoreType2.Name = "cmbCoreType2";
|
||||||
//
|
//
|
||||||
// labCoreType2
|
// labCoreType2
|
||||||
@@ -561,9 +562,9 @@
|
|||||||
//
|
//
|
||||||
// cmbCoreType1
|
// cmbCoreType1
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
|
|
||||||
this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbCoreType1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbCoreType1.FormattingEnabled = true;
|
this.cmbCoreType1.FormattingEnabled = true;
|
||||||
|
resources.ApplyResources(this.cmbCoreType1, "cmbCoreType1");
|
||||||
this.cmbCoreType1.Name = "cmbCoreType1";
|
this.cmbCoreType1.Name = "cmbCoreType1";
|
||||||
//
|
//
|
||||||
// labCoreType1
|
// labCoreType1
|
||||||
@@ -573,17 +574,18 @@
|
|||||||
//
|
//
|
||||||
// tabPage3
|
// tabPage3
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage3, "tabPage3");
|
|
||||||
this.tabPage3.Controls.Add(this.groupBox2);
|
this.tabPage3.Controls.Add(this.groupBox2);
|
||||||
|
resources.ApplyResources(this.tabPage3, "tabPage3");
|
||||||
this.tabPage3.Name = "tabPage3";
|
this.tabPage3.Name = "tabPage3";
|
||||||
this.tabPage3.UseVisualStyleBackColor = true;
|
this.tabPage3.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// groupBox2
|
// groupBox2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
this.groupBox2.Controls.Add(this.chkEnableSystemProxyAdvanced);
|
||||||
this.groupBox2.Controls.Add(this.label13);
|
this.groupBox2.Controls.Add(this.label13);
|
||||||
this.groupBox2.Controls.Add(this.label12);
|
this.groupBox2.Controls.Add(this.label12);
|
||||||
this.groupBox2.Controls.Add(this.txtsystemProxyExceptions);
|
this.groupBox2.Controls.Add(this.txtsystemProxyExceptions);
|
||||||
|
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||||
this.groupBox2.Name = "groupBox2";
|
this.groupBox2.Name = "groupBox2";
|
||||||
this.groupBox2.TabStop = false;
|
this.groupBox2.TabStop = false;
|
||||||
//
|
//
|
||||||
@@ -604,9 +606,9 @@
|
|||||||
//
|
//
|
||||||
// panel2
|
// panel2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.panel2, "panel2");
|
|
||||||
this.panel2.Controls.Add(this.btnClose);
|
this.panel2.Controls.Add(this.btnClose);
|
||||||
this.panel2.Controls.Add(this.btnOK);
|
this.panel2.Controls.Add(this.btnOK);
|
||||||
|
resources.ApplyResources(this.panel2, "panel2");
|
||||||
this.panel2.Name = "panel2";
|
this.panel2.Name = "panel2";
|
||||||
//
|
//
|
||||||
// btnOK
|
// btnOK
|
||||||
@@ -621,6 +623,12 @@
|
|||||||
resources.ApplyResources(this.panel1, "panel1");
|
resources.ApplyResources(this.panel1, "panel1");
|
||||||
this.panel1.Name = "panel1";
|
this.panel1.Name = "panel1";
|
||||||
//
|
//
|
||||||
|
// chkEnableSystemProxyAdvanced
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.chkEnableSystemProxyAdvanced, "chkEnableSystemProxyAdvanced");
|
||||||
|
this.chkEnableSystemProxyAdvanced.Name = "chkEnableSystemProxyAdvanced";
|
||||||
|
this.chkEnableSystemProxyAdvanced.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
// OptionSettingForm
|
// OptionSettingForm
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this, "$this");
|
resources.ApplyResources(this, "$this");
|
||||||
@@ -729,5 +737,6 @@
|
|||||||
private System.Windows.Forms.Label label3;
|
private System.Windows.Forms.Label label3;
|
||||||
private System.Windows.Forms.TextBox txttrayMenuServersLimit;
|
private System.Windows.Forms.TextBox txttrayMenuServersLimit;
|
||||||
private System.Windows.Forms.Label label17;
|
private System.Windows.Forms.Label label17;
|
||||||
|
private System.Windows.Forms.CheckBox chkEnableSystemProxyAdvanced;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,6 +58,8 @@ namespace v2rayN.Forms
|
|||||||
chkdefAllowInsecure.Checked = config.defAllowInsecure;
|
chkdefAllowInsecure.Checked = config.defAllowInsecure;
|
||||||
|
|
||||||
txtsystemProxyExceptions.Text = config.systemProxyExceptions;
|
txtsystemProxyExceptions.Text = config.systemProxyExceptions;
|
||||||
|
|
||||||
|
chkEnableSystemProxyAdvanced.Checked = config.enableSystemProxyAdvanced;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -253,6 +255,8 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
config.systemProxyExceptions = txtsystemProxyExceptions.Text.TrimEx();
|
config.systemProxyExceptions = txtsystemProxyExceptions.Text.TrimEx();
|
||||||
|
|
||||||
|
config.enableSystemProxyAdvanced = chkEnableSystemProxyAdvanced.Checked;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -373,4 +373,7 @@
|
|||||||
<data name="$this.Text" xml:space="preserve">
|
<data name="$this.Text" xml:space="preserve">
|
||||||
<value>参数设置</value>
|
<value>参数设置</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="chkEnableSystemProxyAdvanced.Text" xml:space="preserve">
|
||||||
|
<value>开启系统代理高级设置 (http/https/ftp/socks)</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -42,6 +42,7 @@
|
|||||||
this.label4 = new System.Windows.Forms.Label();
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
this.cmbOutboundTag = new System.Windows.Forms.ComboBox();
|
this.cmbOutboundTag = new System.Windows.Forms.ComboBox();
|
||||||
this.panel4 = new System.Windows.Forms.Panel();
|
this.panel4 = new System.Windows.Forms.Panel();
|
||||||
|
this.chkAutoSort = new System.Windows.Forms.CheckBox();
|
||||||
this.btnClose = new System.Windows.Forms.Button();
|
this.btnClose = new System.Windows.Forms.Button();
|
||||||
this.btnOK = new System.Windows.Forms.Button();
|
this.btnOK = new System.Windows.Forms.Button();
|
||||||
this.panel2 = new System.Windows.Forms.Panel();
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
@@ -63,7 +64,6 @@
|
|||||||
//
|
//
|
||||||
// panel3
|
// panel3
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.panel3, "panel3");
|
|
||||||
this.panel3.Controls.Add(this.chkEnabled);
|
this.panel3.Controls.Add(this.chkEnabled);
|
||||||
this.panel3.Controls.Add(this.clbInboundTag);
|
this.panel3.Controls.Add(this.clbInboundTag);
|
||||||
this.panel3.Controls.Add(this.label2);
|
this.panel3.Controls.Add(this.label2);
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
this.panel3.Controls.Add(this.labRoutingTips);
|
this.panel3.Controls.Add(this.labRoutingTips);
|
||||||
this.panel3.Controls.Add(this.label4);
|
this.panel3.Controls.Add(this.label4);
|
||||||
this.panel3.Controls.Add(this.cmbOutboundTag);
|
this.panel3.Controls.Add(this.cmbOutboundTag);
|
||||||
|
resources.ApplyResources(this.panel3, "panel3");
|
||||||
this.panel3.Name = "panel3";
|
this.panel3.Name = "panel3";
|
||||||
//
|
//
|
||||||
// chkEnabled
|
// chkEnabled
|
||||||
@@ -84,8 +85,8 @@
|
|||||||
//
|
//
|
||||||
// clbInboundTag
|
// clbInboundTag
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.clbInboundTag, "clbInboundTag");
|
|
||||||
this.clbInboundTag.CheckOnClick = true;
|
this.clbInboundTag.CheckOnClick = true;
|
||||||
|
resources.ApplyResources(this.clbInboundTag, "clbInboundTag");
|
||||||
this.clbInboundTag.FormattingEnabled = true;
|
this.clbInboundTag.FormattingEnabled = true;
|
||||||
this.clbInboundTag.Items.AddRange(new object[] {
|
this.clbInboundTag.Items.AddRange(new object[] {
|
||||||
resources.GetString("clbInboundTag.Items"),
|
resources.GetString("clbInboundTag.Items"),
|
||||||
@@ -100,8 +101,8 @@
|
|||||||
//
|
//
|
||||||
// clbProtocol
|
// clbProtocol
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.clbProtocol, "clbProtocol");
|
|
||||||
this.clbProtocol.CheckOnClick = true;
|
this.clbProtocol.CheckOnClick = true;
|
||||||
|
resources.ApplyResources(this.clbProtocol, "clbProtocol");
|
||||||
this.clbProtocol.FormattingEnabled = true;
|
this.clbProtocol.FormattingEnabled = true;
|
||||||
this.clbProtocol.Items.AddRange(new object[] {
|
this.clbProtocol.Items.AddRange(new object[] {
|
||||||
resources.GetString("clbProtocol.Items"),
|
resources.GetString("clbProtocol.Items"),
|
||||||
@@ -127,8 +128,8 @@
|
|||||||
//
|
//
|
||||||
// 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";
|
||||||
//
|
//
|
||||||
// label4
|
// label4
|
||||||
@@ -138,26 +139,33 @@
|
|||||||
//
|
//
|
||||||
// cmbOutboundTag
|
// cmbOutboundTag
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag");
|
|
||||||
this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbOutboundTag.FormattingEnabled = true;
|
this.cmbOutboundTag.FormattingEnabled = true;
|
||||||
this.cmbOutboundTag.Items.AddRange(new object[] {
|
this.cmbOutboundTag.Items.AddRange(new object[] {
|
||||||
resources.GetString("cmbOutboundTag.Items"),
|
resources.GetString("cmbOutboundTag.Items"),
|
||||||
resources.GetString("cmbOutboundTag.Items1"),
|
resources.GetString("cmbOutboundTag.Items1"),
|
||||||
resources.GetString("cmbOutboundTag.Items2")});
|
resources.GetString("cmbOutboundTag.Items2")});
|
||||||
|
resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag");
|
||||||
this.cmbOutboundTag.Name = "cmbOutboundTag";
|
this.cmbOutboundTag.Name = "cmbOutboundTag";
|
||||||
//
|
//
|
||||||
// panel4
|
// panel4
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.panel4, "panel4");
|
this.panel4.Controls.Add(this.chkAutoSort);
|
||||||
this.panel4.Controls.Add(this.btnClose);
|
this.panel4.Controls.Add(this.btnClose);
|
||||||
this.panel4.Controls.Add(this.btnOK);
|
this.panel4.Controls.Add(this.btnOK);
|
||||||
|
resources.ApplyResources(this.panel4, "panel4");
|
||||||
this.panel4.Name = "panel4";
|
this.panel4.Name = "panel4";
|
||||||
//
|
//
|
||||||
|
// chkAutoSort
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.chkAutoSort, "chkAutoSort");
|
||||||
|
this.chkAutoSort.Name = "chkAutoSort";
|
||||||
|
this.chkAutoSort.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
// 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);
|
||||||
@@ -171,15 +179,15 @@
|
|||||||
//
|
//
|
||||||
// panel2
|
// panel2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.panel2, "panel2");
|
|
||||||
this.panel2.Controls.Add(this.groupBox2);
|
this.panel2.Controls.Add(this.groupBox2);
|
||||||
this.panel2.Controls.Add(this.groupBox1);
|
this.panel2.Controls.Add(this.groupBox1);
|
||||||
|
resources.ApplyResources(this.panel2, "panel2");
|
||||||
this.panel2.Name = "panel2";
|
this.panel2.Name = "panel2";
|
||||||
//
|
//
|
||||||
// groupBox2
|
// groupBox2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
|
||||||
this.groupBox2.Controls.Add(this.txtIP);
|
this.groupBox2.Controls.Add(this.txtIP);
|
||||||
|
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||||
this.groupBox2.Name = "groupBox2";
|
this.groupBox2.Name = "groupBox2";
|
||||||
this.groupBox2.TabStop = false;
|
this.groupBox2.TabStop = false;
|
||||||
//
|
//
|
||||||
@@ -190,8 +198,8 @@
|
|||||||
//
|
//
|
||||||
// groupBox1
|
// groupBox1
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
|
||||||
this.groupBox1.Controls.Add(this.txtDomain);
|
this.groupBox1.Controls.Add(this.txtDomain);
|
||||||
|
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||||
this.groupBox1.Name = "groupBox1";
|
this.groupBox1.Name = "groupBox1";
|
||||||
this.groupBox1.TabStop = false;
|
this.groupBox1.TabStop = false;
|
||||||
//
|
//
|
||||||
@@ -214,6 +222,7 @@
|
|||||||
this.panel3.ResumeLayout(false);
|
this.panel3.ResumeLayout(false);
|
||||||
this.panel3.PerformLayout();
|
this.panel3.PerformLayout();
|
||||||
this.panel4.ResumeLayout(false);
|
this.panel4.ResumeLayout(false);
|
||||||
|
this.panel4.PerformLayout();
|
||||||
this.panel2.ResumeLayout(false);
|
this.panel2.ResumeLayout(false);
|
||||||
this.groupBox2.ResumeLayout(false);
|
this.groupBox2.ResumeLayout(false);
|
||||||
this.groupBox2.PerformLayout();
|
this.groupBox2.PerformLayout();
|
||||||
@@ -245,5 +254,6 @@
|
|||||||
private System.Windows.Forms.CheckedListBox clbInboundTag;
|
private System.Windows.Forms.CheckedListBox clbInboundTag;
|
||||||
private System.Windows.Forms.Label label2;
|
private System.Windows.Forms.Label label2;
|
||||||
private System.Windows.Forms.CheckBox chkEnabled;
|
private System.Windows.Forms.CheckBox chkEnabled;
|
||||||
|
private System.Windows.Forms.CheckBox chkAutoSort;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,8 +48,16 @@ namespace v2rayN.Forms
|
|||||||
}
|
}
|
||||||
rulesItem.inboundTag = inboundTag;
|
rulesItem.inboundTag = inboundTag;
|
||||||
rulesItem.outboundTag = cmbOutboundTag.Text;
|
rulesItem.outboundTag = cmbOutboundTag.Text;
|
||||||
|
if (chkAutoSort.Checked)
|
||||||
|
{
|
||||||
rulesItem.domain = Utils.String2ListSorted(txtDomain.Text);
|
rulesItem.domain = Utils.String2ListSorted(txtDomain.Text);
|
||||||
rulesItem.ip = Utils.String2ListSorted(txtIP.Text);
|
rulesItem.ip = Utils.String2ListSorted(txtIP.Text);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rulesItem.domain = Utils.String2List(txtDomain.Text);
|
||||||
|
rulesItem.ip = Utils.String2List(txtIP.Text);
|
||||||
|
}
|
||||||
|
|
||||||
var protocol = new List<string>();
|
var protocol = new List<string>();
|
||||||
for (int i = 0; i < clbProtocol.Items.Count; i++)
|
for (int i = 0; i < clbProtocol.Items.Count; i++)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -170,4 +170,7 @@
|
|||||||
<data name="$this.Text" xml:space="preserve">
|
<data name="$this.Text" xml:space="preserve">
|
||||||
<value>路由规则详情设置</value>
|
<value>路由规则详情设置</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="chkAutoSort.Text" xml:space="preserve">
|
||||||
|
<value>保存时Domain和IP自动排序</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -284,8 +284,18 @@ namespace v2rayN.Handler
|
|||||||
vmessItem.indexId = string.Empty;
|
vmessItem.indexId = string.Empty;
|
||||||
vmessItem.remarks = string.Format("{0}-clone", item.remarks);
|
vmessItem.remarks = string.Format("{0}-clone", item.remarks);
|
||||||
|
|
||||||
|
if (vmessItem.configType == EConfigType.Custom)
|
||||||
|
{
|
||||||
|
vmessItem.address = Utils.GetConfigPath(vmessItem.address);
|
||||||
|
if (AddCustomServer(ref config, vmessItem, false) == 0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
AddServerCommon(ref config, vmessItem);
|
AddServerCommon(ref config, vmessItem);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ToJsonFile(config);
|
ToJsonFile(config);
|
||||||
|
|
||||||
@@ -442,7 +452,7 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File.Copy(fileName, Path.Combine(Utils.GetConfigPath(), newFileName));
|
File.Copy(fileName, Utils.GetConfigPath(newFileName));
|
||||||
if (blDelete)
|
if (blDelete)
|
||||||
{
|
{
|
||||||
File.Delete(fileName);
|
File.Delete(fileName);
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ namespace v2rayN.Handler
|
|||||||
Proxy = webProxy
|
Proxy = webProxy
|
||||||
});
|
});
|
||||||
|
|
||||||
var progress = new Progress<double>();
|
var progress = new Progress<string>();
|
||||||
progress.ProgressChanged += (sender, value) =>
|
progress.ProgressChanged += (sender, value) =>
|
||||||
{
|
{
|
||||||
if (UpdateCompleted != null)
|
if (UpdateCompleted != null)
|
||||||
{
|
{
|
||||||
string msg = string.Format("{0} M/s", value.ToString("#0.0")).PadLeft(9, ' ');
|
string msg = string.Format("{0} M/s", value).PadLeft(9, ' ');
|
||||||
UpdateCompleted(this, new ResultEventArgs(false, msg));
|
UpdateCompleted(this, new ResultEventArgs(false, msg));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ namespace v2rayN.Handler
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
int port = config.GetLocalPort(Global.InboundHttp);
|
int port = config.GetLocalPort(Global.InboundHttp);
|
||||||
|
int portSocks = config.GetLocalPort(Global.InboundSocks);
|
||||||
if (port <= 0)
|
if (port <= 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -67,7 +68,17 @@ namespace v2rayN.Handler
|
|||||||
if (type == ESysProxyType.ForcedChange)
|
if (type == ESysProxyType.ForcedChange)
|
||||||
{
|
{
|
||||||
var strExceptions = $"{config.constItem.defIEProxyExceptions};{config.systemProxyExceptions}";
|
var strExceptions = $"{config.constItem.defIEProxyExceptions};{config.systemProxyExceptions}";
|
||||||
SetIEProxy(true, $"{Global.Loopback}:{port}", strExceptions);
|
|
||||||
|
var strProxy = string.Empty;
|
||||||
|
if (config.enableSystemProxyAdvanced)
|
||||||
|
{
|
||||||
|
strProxy = string.Format("http={0}:{1};https={0}:{1};ftp={0}:{1};socks={0}:{2}", Global.Loopback, port, portSocks);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strProxy = $"{Global.Loopback}:{port}";
|
||||||
|
}
|
||||||
|
SetIEProxy(true, strProxy, strExceptions);
|
||||||
}
|
}
|
||||||
else if (type == ESysProxyType.ForcedClear)
|
else if (type == ESysProxyType.ForcedClear)
|
||||||
{
|
{
|
||||||
@@ -96,41 +107,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetIEProxy(bool enable, bool global, string strProxy)
|
|
||||||
{
|
|
||||||
//Read();
|
|
||||||
|
|
||||||
//if (!_userSettings.UserSettingsRecorded)
|
|
||||||
//{
|
|
||||||
// // record user settings
|
|
||||||
// ExecSysproxy("query");
|
|
||||||
// //ParseQueryStr(_queryStr);
|
|
||||||
//}
|
|
||||||
|
|
||||||
string arguments;
|
|
||||||
if (enable)
|
|
||||||
{
|
|
||||||
arguments = global
|
|
||||||
? $"global {strProxy} {Global.IEProxyExceptions}"
|
|
||||||
: $"pac {strProxy}";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// restore user settings
|
|
||||||
string flags = _userSettings.Flags;
|
|
||||||
string proxy_server = _userSettings.ProxyServer ?? "-";
|
|
||||||
string bypass_list = _userSettings.BypassList ?? "-";
|
|
||||||
string pac_url = _userSettings.PacUrl ?? "-";
|
|
||||||
arguments = $"set {flags} {proxy_server} {bypass_list} {pac_url}";
|
|
||||||
|
|
||||||
// have to get new settings
|
|
||||||
_userSettings.UserSettingsRecorded = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Save();
|
|
||||||
ExecSysproxy(arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void SetIEProxy(bool global, string strProxy, string strExceptions)
|
public static void SetIEProxy(bool global, string strProxy, string strExceptions)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using v2rayN.Base;
|
using v2rayN.Base;
|
||||||
@@ -178,6 +179,16 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
|
//Turn off system proxy
|
||||||
|
bool bSysProxyType = false;
|
||||||
|
if (!blProxy && config.sysProxyType == ESysProxyType.ForcedChange)
|
||||||
|
{
|
||||||
|
bSysProxyType = true;
|
||||||
|
config.sysProxyType = ESysProxyType.ForcedClear;
|
||||||
|
SysProxyHandle.UpdateSysProxy(config, false);
|
||||||
|
Thread.Sleep(3000);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var item in config.subItem)
|
foreach (var item in config.subItem)
|
||||||
{
|
{
|
||||||
if (item.enabled == false)
|
if (item.enabled == false)
|
||||||
@@ -217,7 +228,14 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
_updateFunc(false, $"-------------------------------------------------------");
|
_updateFunc(false, $"-------------------------------------------------------");
|
||||||
}
|
}
|
||||||
|
//restore system proxy
|
||||||
|
if (bSysProxyType)
|
||||||
|
{
|
||||||
|
config.sysProxyType = ESysProxyType.ForcedChange;
|
||||||
|
SysProxyHandle.UpdateSysProxy(config, false);
|
||||||
|
}
|
||||||
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -941,7 +941,7 @@ namespace v2rayN.Handler
|
|||||||
string addressFileName = node.address;
|
string addressFileName = node.address;
|
||||||
if (!File.Exists(addressFileName))
|
if (!File.Exists(addressFileName))
|
||||||
{
|
{
|
||||||
addressFileName = Path.Combine(Utils.GetConfigPath(), addressFileName);
|
addressFileName = Utils.GetConfigPath(addressFileName);
|
||||||
}
|
}
|
||||||
if (!File.Exists(addressFileName))
|
if (!File.Exists(addressFileName))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ namespace v2rayN.Mode
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
public bool enableSystemProxyAdvanced { get; set; }
|
||||||
|
|
||||||
public int autoUpdateInterval { get; set; } = 0;
|
public int autoUpdateInterval { get; set; } = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
|
|||||||
// 方法是按如下所示使用“*”:
|
// 方法是按如下所示使用“*”:
|
||||||
//[assembly: AssemblyVersion("1.0.*")]
|
//[assembly: AssemblyVersion("1.0.*")]
|
||||||
//[assembly: AssemblyVersion("1.0.0")]
|
//[assembly: AssemblyVersion("1.0.0")]
|
||||||
[assembly: AssemblyFileVersion("5.17")]
|
[assembly: AssemblyFileVersion("5.19")]
|
||||||
|
|||||||
Reference in New Issue
Block a user