Merge pull request #1 from 2dust/master

update from 2dust
This commit is contained in:
Elvir 2021-02-21 12:40:32 +08:00 committed by GitHub
commit a0321df8a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
110 changed files with 20195 additions and 14322 deletions

View file

@ -1,101 +0,0 @@
using System;
using System.Net;
using System.Text;
using System.Threading;
namespace v2rayN.Base
{
public class HttpWebServer
{
private HttpListener _listener;
private Func<string, string> _responderMethod;
public HttpWebServer(string[] prefixes, Func<string, string> method)
{
try
{
_listener = new HttpListener();
if (!HttpListener.IsSupported)
throw new NotSupportedException(
"Needs Windows XP SP2, Server 2003 or later.");
// URI prefixes are required, for example
// "http://localhost:8080/index/".
if (prefixes == null || prefixes.Length == 0)
throw new ArgumentException("prefixes");
// A responder method is required
if (method == null)
throw new ArgumentException("method");
foreach (string s in prefixes)
_listener.Prefixes.Add(s);
_responderMethod = method;
_listener.Start();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
throw;
}
}
public HttpWebServer(Func<string, string> method, params string[] prefixes)
: this(prefixes, method) { }
public void Run()
{
ThreadPool.QueueUserWorkItem((o) =>
{
Utils.SaveLog("Webserver running...");
try
{
while (_listener.IsListening)
{
ThreadPool.QueueUserWorkItem((c) =>
{
HttpListenerContext ctx = c as HttpListenerContext;
try
{
string address = ctx.Request.LocalEndPoint.Address.ToString();
Utils.SaveLog("Webserver Request " + address);
string rstr = _responderMethod(address);
byte[] buf = Encoding.UTF8.GetBytes(rstr);
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = "application/x-ns-proxy-autoconfig";
ctx.Response.ContentLength64 = buf.Length;
ctx.Response.OutputStream.Write(buf, 0, buf.Length);
}
catch
{
} // suppress any exceptions
finally
{
// always close the stream
ctx.Response.OutputStream.Close();
}
}, _listener.GetContext());
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
} // suppress any exceptions
});
}
public void Stop()
{
if (_listener != null)
{
_listener.Stop();
_listener.Close();
_listener = null;
}
}
}
}

View file

@ -1,141 +0,0 @@
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace v2rayN.Base
{
public class HttpWebServerB
{
private TcpListener listener;
private int port;
private Func<string, string> _responderMethod;
public HttpWebServerB(int port, Func<string, string> method)
{
this.port = port;
this._responderMethod = method;
Thread thread = new Thread(StartListen)
{
IsBackground = true
};
thread.Start();
}
public void Stop()
{
if (listener != null)
{
listener.Stop();
listener = null;
}
}
private void StartListen()
{
try
{
listener = new TcpListener(IPAddress.Any, port);
listener.Start();
Utils.SaveLog("WebserverB running...");
while (true)
{
if (!listener.Pending())
{
Thread.Sleep(100);
continue;
}
TcpClient socket = listener.AcceptTcpClient();
Thread thread = new Thread(new ParameterizedThreadStart(ProcessThread))
{
IsBackground = true
};
thread.Start(socket);
Thread.Sleep(1);
}
}
catch
{
Utils.SaveLog("WebserverB start fail.");
}
}
private void ProcessThread(object obj)
{
try
{
TcpClient socket = obj as TcpClient;
BufferedStream inputStream = new BufferedStream(socket.GetStream());
StreamWriter outputStream = new StreamWriter(new BufferedStream(socket.GetStream()));
if (inputStream.CanRead)
{
string data = ReadStream(inputStream);
if (data.Contains("/pac/"))
{
if (_responderMethod != null)
{
string address = ((IPEndPoint)socket.Client.LocalEndPoint).Address.ToString();
Utils.SaveLog("WebserverB Request " + address);
string pac = _responderMethod(address);
if (inputStream.CanWrite)
{
WriteStream(outputStream, pac);
}
}
}
}
outputStream.BaseStream.Flush();
inputStream = null;
outputStream = null;
socket.Close();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private string ReadStream(Stream inputStream)
{
int nextchar;
string data = "";
while (true)
{
nextchar = inputStream.ReadByte();
if (nextchar == '\n')
{
break;
}
if (nextchar == '\r')
{
continue;
}
if (nextchar == -1)
{
Thread.Sleep(1);
continue;
};
data += Convert.ToChar(nextchar);
}
return data;
}
private void WriteStream(StreamWriter outputStream, string pac)
{
string content_type = "application/x-ns-proxy-autoconfig";
outputStream.WriteLine("HTTP/1.1 200 OK");
outputStream.WriteLine(String.Format("Content-Type:{0}", content_type));
outputStream.WriteLine("Connection: close");
outputStream.WriteLine("");
outputStream.WriteLine(pac);
outputStream.Flush();
}
}
}

View file

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

View file

@ -5,10 +5,8 @@ using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class AddServer2Form : BaseForm
{
public int EditIndex { get; set; }
VmessItem vmessItem;
public partial class AddServer2Form : BaseServerForm
{
public AddServer2Form()
{

View file

@ -93,9 +93,7 @@
resources.GetString("cmbSecurity.Items2"),
resources.GetString("cmbSecurity.Items3"),
resources.GetString("cmbSecurity.Items4"),
resources.GetString("cmbSecurity.Items5"),
resources.GetString("cmbSecurity.Items6"),
resources.GetString("cmbSecurity.Items7")});
resources.GetString("cmbSecurity.Items5")});
resources.ApplyResources(this.cmbSecurity, "cmbSecurity");
this.cmbSecurity.Name = "cmbSecurity";
//

View file

@ -5,10 +5,8 @@ using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class AddServer3Form : BaseForm
{
public int EditIndex { get; set; }
VmessItem vmessItem = null;
public partial class AddServer3Form : BaseServerForm
{
public AddServer3Form()
{
@ -121,7 +119,7 @@ namespace v2rayN.Forms
{
ClearServer();
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.ShowWarning(msg);

View file

@ -118,107 +118,31 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<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" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>547, 291</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Edit or add a [Shadowsocks] server</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
<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="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="cmbSecurity.Items" xml:space="preserve">
<value>aes-256-cfb</value>
</data>
<data name="cmbSecurity.Items1" xml:space="preserve">
<value>aes-128-cfb</value>
</data>
<data name="cmbSecurity.Items2" xml:space="preserve">
<value>chacha20</value>
</data>
<data name="cmbSecurity.Items3" xml:space="preserve">
<value>chacha20-ietf</value>
</data>
<data name="cmbSecurity.Items4" xml:space="preserve">
<value>aes-256-gcm</value>
</data>
<data name="cmbSecurity.Items5" xml:space="preserve">
<value>aes-128-gcm</value>
</data>
<data name="cmbSecurity.Items6" xml:space="preserve">
<value>chacha20-poly1305</value>
</data>
<data name="cmbSecurity.Items7" xml:space="preserve">
<value>chacha20-ietf-poly1305</value>
</data>
<data name="cmbSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 120</value>
</data>
<data name="cmbSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 20</value>
</data>
<data name="cmbSecurity.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 35</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 196</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 31</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Server address</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@ -234,35 +158,104 @@
<data name="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
<data name="&gt;&gt;label13.Name" xml:space="preserve">
<value>label13</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 60</value>
<data name="&gt;&gt;label13.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.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
<data name="&gt;&gt;label13.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="cmbSecurity.Items" xml:space="preserve">
<value>aes-256-gcm</value>
</data>
<data name="cmbSecurity.Items1" xml:space="preserve">
<value>aes-128-gcm</value>
</data>
<data name="cmbSecurity.Items2" xml:space="preserve">
<value>chacha20-poly1305</value>
</data>
<data name="cmbSecurity.Items3" xml:space="preserve">
<value>chacha20-ietf-poly1305</value>
</data>
<data name="cmbSecurity.Items4" xml:space="preserve">
<value>none</value>
</data>
<data name="cmbSecurity.Items5" xml:space="preserve">
<value>plain</value>
</data>
<data name="cmbSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 123</value>
</data>
<data name="cmbSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 20</value>
</data>
<data name="cmbSecurity.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;cmbSecurity.Name" xml:space="preserve">
<value>cmbSecurity</value>
</data>
<data name="&gt;&gt;cmbSecurity.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;cmbSecurity.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;cmbSecurity.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 154</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Server port</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 89</value>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 155</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Password</value>
<data name="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
</data>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="&gt;&gt;label6.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;label6.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -279,56 +272,216 @@
<data name="label5.Text" xml:space="preserve">
<value>Encryption</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<data name="&gt;&gt;label5.Name" xml:space="preserve">
<value>label5</value>
</data>
<data name="&gt;&gt;label5.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;label5.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 91</value>
</data>
<data name="txtId.PasswordChar" type="System.Char, mscorlib" xml:space="preserve">
<value>*</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 21</value>
</data>
<data name="txtId.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;txtId.Name" xml:space="preserve">
<value>txtId</value>
</data>
<data name="&gt;&gt;txtId.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;txtId.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtId.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 158</value>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 93</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
<data name="label3.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>162, 21</value>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Import configuration file</value>
<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="menuItemImportClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>235, 22</value>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="menuItemImportClipboard.Text" xml:space="preserve">
<value>Import URL from clipboard</value>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="menuServer.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 59</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 25</value>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="menuServer.TabIndex" type="System.Int32, mscorlib">
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</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;txtPort.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 62</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Server port</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</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="&gt;&gt;label2.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing">
<value>17, 17</value>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 27</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 25</value>
<data name="txtAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 10</value>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
<data name="&gt;&gt;txtAddress.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;txtAddress.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 31</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Server address</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 35</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 196</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
@ -342,43 +495,106 @@
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 27</value>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
<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="txtAddress.TabIndex" type="System.Int32, mscorlib">
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 85</value>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="txtId.PasswordChar" type="System.Char, mscorlib" xml:space="preserve">
<value>*</value>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 25</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 21</value>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 10</value>
</data>
<data name="txtId.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 56</value>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</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="txtPort.TabIndex" type="System.Int32, mscorlib">
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<metadata name="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="menuItemImportClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>235, 22</value>
</data>
<data name="menuItemImportClipboard.Text" xml:space="preserve">
<value>Import URL from clipboard</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>162, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Import configuration file</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>547, 25</value>
</data>
<data name="menuServer.TabIndex" type="System.Int32, mscorlib">
<value>8</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>3</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 154</value>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>547, 291</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
<data name="$this.Text" xml:space="preserve">
<value>Edit or add a [Shadowsocks] server</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;menuItemImportClipboard.Name" xml:space="preserve">
<value>menuItemImportClipboard</value>
</data>
<data name="&gt;&gt;menuItemImportClipboard.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>AddServer3Form</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseServerForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -117,40 +117,62 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.Text" xml:space="preserve">
<value>编辑或添加[Shadowsocks]服务器</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>服务器地址</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>服务器端口</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>密码</value>
</data>
<data name="label5.Text" xml:space="preserve">
<value>加密方式</value>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>别名(remarks)</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label5.Text" xml:space="preserve">
<value>加密方式</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>密码</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>服务器端口</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>服务器地址</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</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="menuItemImportClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>171, 22</value>
</data>
<data name="menuItemImportClipboard.Text" xml:space="preserve">
<value>从剪贴板导入URL</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>编辑或添加[Shadowsocks]服务器</value>
</data>
</root>

View file

@ -55,14 +55,15 @@
//
// 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);
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.txtSecurity);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.txtId);
@ -74,7 +75,6 @@
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtAddress);
this.groupBox1.Controls.Add(this.label1);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
@ -135,9 +135,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
@ -154,22 +154,22 @@
//
// menuServer
//
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItem1});
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Name = "menuServer";
//
// MenuItem1
//
resources.ApplyResources(this.MenuItem1, "MenuItem1");
this.MenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemImportClipboard});
this.MenuItem1.Name = "MenuItem1";
resources.ApplyResources(this.MenuItem1, "MenuItem1");
//
// menuItemImportClipboard
//
this.menuItemImportClipboard.Name = "menuItemImportClipboard";
resources.ApplyResources(this.menuItemImportClipboard, "menuItemImportClipboard");
this.menuItemImportClipboard.Name = "menuItemImportClipboard";
this.menuItemImportClipboard.Click += new System.EventHandler(this.menuItemImportClipboard_Click);
//
// AddServer4Form

View file

@ -5,10 +5,8 @@ using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class AddServer4Form : BaseForm
{
public int EditIndex { get; set; }
VmessItem vmessItem = null;
public partial class AddServer4Form : BaseServerForm
{
public AddServer4Form()
{
@ -110,7 +108,7 @@ namespace v2rayN.Forms
{
ClearServer();
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.ShowWarning(msg);

View file

@ -118,249 +118,471 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<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" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>547, 291</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Edit or add a [Socks] server</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 35</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 196</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 31</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Server address</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>337, 158</value>
</data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="label13.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 60</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Server port</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 121</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Password(Optional)</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 88</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>User(Optional)</value>
<data name="&gt;&gt;txtSecurity.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 158</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="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>162, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Import configuration file</value>
</data>
<data name="menuItemImportClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>235, 22</value>
</data>
<data name="menuItemImportClipboard.Text" xml:space="preserve">
<value>Import URL from clipboard</value>
</data>
<data name="menuServer.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 25</value>
</data>
<data name="menuServer.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing">
<value>17, 17</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, 25</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 10</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<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>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 231</value>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Import configuration file</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 60</value>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Password(Optional)</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;label6.Parent" xml:space="preserve">
<value>groupBox1</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="&gt;&gt;menuItemImportClipboard.Name" xml:space="preserve">
<value>menuItemImportClipboard</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="menuServer.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 27</value>
</data>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
<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="txtAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 117</value>
<data name="$this.Text" xml:space="preserve">
<value>Edit or add a [Socks] server</value>
</data>
<data name="txtId.PasswordChar" type="System.Char, mscorlib" xml:space="preserve">
<value>*</value>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 21</value>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="txtId.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 56</value>
<data name="menuItemImportClipboard.Text" xml:space="preserve">
<value>Import URL from clipboard</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>3</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="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 154</value>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
<data name="&gt;&gt;MenuItem1.Name" xml:space="preserve">
<value>MenuItem1</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 84</value>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="txtSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 21</value>
<data name="&gt;&gt;txtAddress.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="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 17</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="menuServer.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 60</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 25</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label13.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>162, 21</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 120</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtSecurity.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
</data>
<data name="&gt;&gt;txtId.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;menuServer.Name" xml:space="preserve">
<value>menuServer</value>
</data>
<data name="&gt;&gt;label13.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label13.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="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;txtId.Name" xml:space="preserve">
<value>txtId</value>
</data>
<data name="menuItemImportClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>235, 22</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 93</value>
</data>
<data name="&gt;&gt;txtId.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.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>12, 31</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>AddServer4Form</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 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>groupBox1</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 58</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;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;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</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;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>groupBox1</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>panel2</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 10</value>
</data>
<data name="txtId.PasswordChar" type="System.Char, mscorlib" xml:space="preserve">
<value>*</value>
</data>
<data name="&gt;&gt;txtId.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;txtSecurity.Name" xml:space="preserve">
<value>txtSecurity</value>
</data>
<data name="&gt;&gt;menuServer.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;menuItemImportClipboard.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;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="txtSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 21</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;menuServer.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 124</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="txtAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</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="panel1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;label13.Name" xml:space="preserve">
<value>label13</value>
</data>
<data name="&gt;&gt;label6.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;txtSecurity.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;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Server port</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="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 231</value>
</data>
<data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="label13.AutoSize" 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>Server address</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 151</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</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="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 62</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>547, 291</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 196</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;txtSecurity.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="txtSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 89</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>337, 155</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="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="&gt;&gt;txtAddress.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 35</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 155</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>User(Optional)</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 21</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>3</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="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -117,45 +117,15 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Text" xml:space="preserve">
<value>编辑或添加[Socks]服务器</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>服务器地址</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>服务器端口</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 119</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>密码(可选)</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 89</value>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="txtSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
@ -163,12 +133,39 @@
<data name="label4.Text" xml:space="preserve">
<value>用户名(可选)</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>密码(可选)</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>别名(remarks)</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>服务器端口</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>服务器地址</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>92, 21</value>
</data>
@ -181,10 +178,7 @@
<data name="menuItemImportClipboard.Text" xml:space="preserve">
<value>从剪贴板导入URL</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 115</value>
</data>
<data name="txtSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 85</value>
<data name="$this.Text" xml:space="preserve">
<value>编辑或添加[Socks]服务器</value>
</data>
</root>

View file

@ -0,0 +1,529 @@
namespace v2rayN.Forms
{
partial class AddServer5Form
{
/// <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(AddServer5Form));
this.btnClose = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmbFlow = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.btnGUID = new System.Windows.Forms.Button();
this.label13 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label24 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.panTlsMore = new System.Windows.Forms.Panel();
this.txtSNI = new System.Windows.Forms.TextBox();
this.label22 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.cmbAllowInsecure = new System.Windows.Forms.ComboBox();
this.label9 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.txtPath = new System.Windows.Forms.TextBox();
this.cmbNetwork = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.cmbStreamSecurity = new System.Windows.Forms.ComboBox();
this.label12 = new System.Windows.Forms.Label();
this.txtRequestHost = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.cmbHeaderType = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
this.cmbSecurity = new System.Windows.Forms.ComboBox();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.txtId = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtPort = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtAddress = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.menuServer = new System.Windows.Forms.MenuStrip();
this.MenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.MenuItemImportClient = new System.Windows.Forms.ToolStripMenuItem();
this.MenuItemImportServer = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.MenuItemImportClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.panTlsMore.SuspendLayout();
this.panel2.SuspendLayout();
this.menuServer.SuspendLayout();
this.SuspendLayout();
//
// 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);
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.cmbFlow);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.btnGUID);
this.groupBox1.Controls.Add(this.label13);
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.cmbSecurity);
this.groupBox1.Controls.Add(this.txtRemarks);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtId);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.txtPort);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtAddress);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// cmbFlow
//
resources.ApplyResources(this.cmbFlow, "cmbFlow");
this.cmbFlow.FormattingEnabled = true;
this.cmbFlow.Items.AddRange(new object[] {
resources.GetString("cmbFlow.Items"),
resources.GetString("cmbFlow.Items1"),
resources.GetString("cmbFlow.Items2"),
resources.GetString("cmbFlow.Items3"),
resources.GetString("cmbFlow.Items4")});
this.cmbFlow.Name = "cmbFlow";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// btnGUID
//
resources.ApplyResources(this.btnGUID, "btnGUID");
this.btnGUID.Name = "btnGUID";
this.btnGUID.UseVisualStyleBackColor = true;
this.btnGUID.Click += new System.EventHandler(this.btnGUID_Click);
//
// label13
//
resources.ApplyResources(this.label13, "label13");
this.label13.Name = "label13";
//
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.label24);
this.groupBox2.Controls.Add(this.label23);
this.groupBox2.Controls.Add(this.panTlsMore);
this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.label20);
this.groupBox2.Controls.Add(this.txtPath);
this.groupBox2.Controls.Add(this.cmbNetwork);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.label19);
this.groupBox2.Controls.Add(this.label18);
this.groupBox2.Controls.Add(this.label17);
this.groupBox2.Controls.Add(this.label16);
this.groupBox2.Controls.Add(this.label14);
this.groupBox2.Controls.Add(this.label15);
this.groupBox2.Controls.Add(this.cmbStreamSecurity);
this.groupBox2.Controls.Add(this.label12);
this.groupBox2.Controls.Add(this.txtRequestHost);
this.groupBox2.Controls.Add(this.label11);
this.groupBox2.Controls.Add(this.label10);
this.groupBox2.Controls.Add(this.cmbHeaderType);
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// label24
//
resources.ApplyResources(this.label24, "label24");
this.label24.Name = "label24";
//
// label23
//
resources.ApplyResources(this.label23, "label23");
this.label23.Name = "label23";
//
// panTlsMore
//
resources.ApplyResources(this.panTlsMore, "panTlsMore");
this.panTlsMore.Controls.Add(this.txtSNI);
this.panTlsMore.Controls.Add(this.label22);
this.panTlsMore.Controls.Add(this.label21);
this.panTlsMore.Controls.Add(this.cmbAllowInsecure);
this.panTlsMore.Name = "panTlsMore";
//
// txtSNI
//
resources.ApplyResources(this.txtSNI, "txtSNI");
this.txtSNI.Name = "txtSNI";
//
// label22
//
resources.ApplyResources(this.label22, "label22");
this.label22.Name = "label22";
//
// label21
//
resources.ApplyResources(this.label21, "label21");
this.label21.Name = "label21";
//
// cmbAllowInsecure
//
resources.ApplyResources(this.cmbAllowInsecure, "cmbAllowInsecure");
this.cmbAllowInsecure.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbAllowInsecure.FormattingEnabled = true;
this.cmbAllowInsecure.Items.AddRange(new object[] {
resources.GetString("cmbAllowInsecure.Items"),
resources.GetString("cmbAllowInsecure.Items1"),
resources.GetString("cmbAllowInsecure.Items2")});
this.cmbAllowInsecure.Name = "cmbAllowInsecure";
//
// label9
//
resources.ApplyResources(this.label9, "label9");
this.label9.Name = "label9";
//
// label20
//
resources.ApplyResources(this.label20, "label20");
this.label20.Name = "label20";
//
// txtPath
//
resources.ApplyResources(this.txtPath, "txtPath");
this.txtPath.Name = "txtPath";
//
// cmbNetwork
//
resources.ApplyResources(this.cmbNetwork, "cmbNetwork");
this.cmbNetwork.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbNetwork.FormattingEnabled = true;
this.cmbNetwork.Items.AddRange(new object[] {
resources.GetString("cmbNetwork.Items"),
resources.GetString("cmbNetwork.Items1"),
resources.GetString("cmbNetwork.Items2"),
resources.GetString("cmbNetwork.Items3"),
resources.GetString("cmbNetwork.Items4")});
this.cmbNetwork.Name = "cmbNetwork";
this.cmbNetwork.SelectedIndexChanged += new System.EventHandler(this.cmbNetwork_SelectedIndexChanged);
//
// label7
//
resources.ApplyResources(this.label7, "label7");
this.label7.Name = "label7";
//
// label19
//
resources.ApplyResources(this.label19, "label19");
this.label19.Name = "label19";
//
// label18
//
resources.ApplyResources(this.label18, "label18");
this.label18.Name = "label18";
//
// label17
//
resources.ApplyResources(this.label17, "label17");
this.label17.Name = "label17";
//
// label16
//
resources.ApplyResources(this.label16, "label16");
this.label16.Name = "label16";
//
// label14
//
resources.ApplyResources(this.label14, "label14");
this.label14.Name = "label14";
//
// label15
//
resources.ApplyResources(this.label15, "label15");
this.label15.Name = "label15";
//
// cmbStreamSecurity
//
resources.ApplyResources(this.cmbStreamSecurity, "cmbStreamSecurity");
this.cmbStreamSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbStreamSecurity.FormattingEnabled = true;
this.cmbStreamSecurity.Items.AddRange(new object[] {
resources.GetString("cmbStreamSecurity.Items"),
resources.GetString("cmbStreamSecurity.Items1"),
resources.GetString("cmbStreamSecurity.Items2")});
this.cmbStreamSecurity.Name = "cmbStreamSecurity";
this.cmbStreamSecurity.SelectedIndexChanged += new System.EventHandler(this.cmbStreamSecurity_SelectedIndexChanged);
//
// label12
//
resources.ApplyResources(this.label12, "label12");
this.label12.Name = "label12";
//
// txtRequestHost
//
resources.ApplyResources(this.txtRequestHost, "txtRequestHost");
this.txtRequestHost.Name = "txtRequestHost";
//
// label11
//
resources.ApplyResources(this.label11, "label11");
this.label11.Name = "label11";
//
// label10
//
resources.ApplyResources(this.label10, "label10");
this.label10.Name = "label10";
//
// cmbHeaderType
//
resources.ApplyResources(this.cmbHeaderType, "cmbHeaderType");
this.cmbHeaderType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbHeaderType.FormattingEnabled = true;
this.cmbHeaderType.Items.AddRange(new object[] {
resources.GetString("cmbHeaderType.Items"),
resources.GetString("cmbHeaderType.Items1"),
resources.GetString("cmbHeaderType.Items2"),
resources.GetString("cmbHeaderType.Items3"),
resources.GetString("cmbHeaderType.Items4"),
resources.GetString("cmbHeaderType.Items5"),
resources.GetString("cmbHeaderType.Items6")});
this.cmbHeaderType.Name = "cmbHeaderType";
//
// label8
//
resources.ApplyResources(this.label8, "label8");
this.label8.Name = "label8";
//
// cmbSecurity
//
resources.ApplyResources(this.cmbSecurity, "cmbSecurity");
this.cmbSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
this.cmbSecurity.FormattingEnabled = true;
this.cmbSecurity.Items.AddRange(new object[] {
resources.GetString("cmbSecurity.Items")});
this.cmbSecurity.Name = "cmbSecurity";
//
// txtRemarks
//
resources.ApplyResources(this.txtRemarks, "txtRemarks");
this.txtRemarks.Name = "txtRemarks";
//
// label6
//
resources.ApplyResources(this.label6, "label6");
this.label6.Name = "label6";
//
// label5
//
resources.ApplyResources(this.label5, "label5");
this.label5.Name = "label5";
//
// txtId
//
resources.ApplyResources(this.txtId, "txtId");
this.txtId.Name = "txtId";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// txtPort
//
resources.ApplyResources(this.txtPort, "txtPort");
this.txtPort.Name = "txtPort";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// txtAddress
//
resources.ApplyResources(this.txtAddress, "txtAddress");
this.txtAddress.Name = "txtAddress";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
this.panel2.Name = "panel2";
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// menuServer
//
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItem1});
this.menuServer.Name = "menuServer";
//
// MenuItem1
//
resources.ApplyResources(this.MenuItem1, "MenuItem1");
this.MenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItemImportClient,
this.MenuItemImportServer,
this.toolStripSeparator1,
this.MenuItemImportClipboard});
this.MenuItem1.Name = "MenuItem1";
//
// MenuItemImportClient
//
resources.ApplyResources(this.MenuItemImportClient, "MenuItemImportClient");
this.MenuItemImportClient.Name = "MenuItemImportClient";
this.MenuItemImportClient.Click += new System.EventHandler(this.MenuItemImportClient_Click);
//
// MenuItemImportServer
//
resources.ApplyResources(this.MenuItemImportServer, "MenuItemImportServer");
this.MenuItemImportServer.Name = "MenuItemImportServer";
this.MenuItemImportServer.Click += new System.EventHandler(this.MenuItemImportServer_Click);
//
// toolStripSeparator1
//
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
this.toolStripSeparator1.Name = "toolStripSeparator1";
//
// MenuItemImportClipboard
//
resources.ApplyResources(this.MenuItemImportClipboard, "MenuItemImportClipboard");
this.MenuItemImportClipboard.Name = "MenuItemImportClipboard";
this.MenuItemImportClipboard.Click += new System.EventHandler(this.MenuItemImportClipboard_Click);
//
// AddServer5Form
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.menuServer);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "AddServer5Form";
this.Load += new System.EventHandler(this.AddServer5Form_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.panTlsMore.ResumeLayout(false);
this.panTlsMore.PerformLayout();
this.panel2.ResumeLayout(false);
this.menuServer.ResumeLayout(false);
this.menuServer.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtId;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtPort;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtAddress;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cmbSecurity;
private System.Windows.Forms.ComboBox cmbNetwork;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.TextBox txtRequestHost;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.ComboBox cmbHeaderType;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.MenuStrip menuServer;
private System.Windows.Forms.ToolStripMenuItem MenuItem1;
private System.Windows.Forms.ToolStripMenuItem MenuItemImportClient;
private System.Windows.Forms.ToolStripMenuItem MenuItemImportServer;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.ComboBox cmbStreamSecurity;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem MenuItemImportClipboard;
private System.Windows.Forms.Button btnGUID;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.TextBox txtPath;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.ComboBox cmbAllowInsecure;
private System.Windows.Forms.Panel panTlsMore;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.ComboBox cmbFlow;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtSNI;
private System.Windows.Forms.Label label22;
}
}

View file

@ -0,0 +1,290 @@
using System;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class AddServer5Form : BaseServerForm
{
public AddServer5Form()
{
InitializeComponent();
}
private void AddServer5Form_Load(object sender, EventArgs e)
{
if (EditIndex >= 0)
{
vmessItem = config.vmess[EditIndex];
BindingServer();
}
else
{
vmessItem = new VmessItem();
ClearServer();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindingServer()
{
txtAddress.Text = vmessItem.address;
txtPort.Text = vmessItem.port.ToString();
txtId.Text = vmessItem.id;
cmbFlow.Text = vmessItem.flow;
cmbSecurity.Text = vmessItem.security;
cmbNetwork.Text = vmessItem.network;
txtRemarks.Text = vmessItem.remarks;
cmbHeaderType.Text = vmessItem.headerType;
txtRequestHost.Text = vmessItem.requestHost;
txtPath.Text = vmessItem.path;
cmbStreamSecurity.Text = vmessItem.streamSecurity;
cmbAllowInsecure.Text = vmessItem.allowInsecure;
txtSNI.Text = vmessItem.sni;
}
/// <summary>
/// 清除设置
/// </summary>
private void ClearServer()
{
txtAddress.Text = "";
txtPort.Text = "";
txtId.Text = "";
cmbFlow.Text = "";
cmbSecurity.Text = Global.None;
cmbNetwork.Text = Global.DefaultNetwork;
txtRemarks.Text = "";
cmbHeaderType.Text = Global.None;
txtRequestHost.Text = "";
cmbStreamSecurity.Text = "";
cmbAllowInsecure.Text = "";
txtPath.Text = "";
txtSNI.Text = "";
}
private void cmbNetwork_SelectedIndexChanged(object sender, EventArgs e)
{
SetHeaderType();
}
/// <summary>
/// 设置伪装选项
/// </summary>
private void SetHeaderType()
{
cmbHeaderType.Items.Clear();
string network = cmbNetwork.Text;
if (Utils.IsNullOrEmpty(network))
{
cmbHeaderType.Items.Add(Global.None);
return;
}
cmbHeaderType.Items.Add(Global.None);
if (network.Equals(Global.DefaultNetwork))
{
cmbHeaderType.Items.Add(Global.TcpHeaderHttp);
}
else if (network.Equals("kcp") || network.Equals("quic"))
{
cmbHeaderType.Items.Add("srtp");
cmbHeaderType.Items.Add("utp");
cmbHeaderType.Items.Add("wechat-video");
cmbHeaderType.Items.Add("dtls");
cmbHeaderType.Items.Add("wireguard");
}
else
{
}
cmbHeaderType.Text = Global.None;
}
private void btnOK_Click(object sender, EventArgs e)
{
string address = txtAddress.Text;
string port = txtPort.Text;
string id = txtId.Text;
string flow = cmbFlow.Text;
string security = cmbSecurity.Text;
string network = cmbNetwork.Text;
string remarks = txtRemarks.Text;
string headerType = cmbHeaderType.Text;
string requestHost = txtRequestHost.Text;
string path = txtPath.Text;
string streamSecurity = cmbStreamSecurity.Text;
string allowInsecure = cmbAllowInsecure.Text;
string sni = txtSNI.Text;
if (Utils.IsNullOrEmpty(address))
{
UI.Show(UIRes.I18N("FillServerAddress"));
return;
}
if (Utils.IsNullOrEmpty(port) || !Utils.IsNumberic(port))
{
UI.Show(UIRes.I18N("FillCorrectServerPort"));
return;
}
if (Utils.IsNullOrEmpty(id))
{
UI.Show(UIRes.I18N("FillUUID"));
return;
}
vmessItem.address = address;
vmessItem.port = Utils.ToInt(port);
vmessItem.id = id;
vmessItem.flow = flow;
vmessItem.security = security;
vmessItem.network = network;
vmessItem.remarks = remarks;
vmessItem.headerType = headerType;
vmessItem.requestHost = requestHost.Replace(" ", "");
vmessItem.path = path.Replace(" ", "");
vmessItem.streamSecurity = streamSecurity;
vmessItem.allowInsecure = allowInsecure;
vmessItem.sni = sni;
if (ConfigHandler.AddVlessServer(ref config, vmessItem, EditIndex) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnGUID_Click(object sender, EventArgs e)
{
txtId.Text = Utils.GetGUID();
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
private void cmbStreamSecurity_SelectedIndexChanged(object sender, EventArgs e)
{
string security = cmbStreamSecurity.Text;
if (Utils.IsNullOrEmpty(security))
{
panTlsMore.Hide();
}
else
{
panTlsMore.Show();
}
}
#region /
/// <summary>
/// 导入客户端
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MenuItemImportClient_Click(object sender, EventArgs e)
{
MenuItemImport(1);
}
/// <summary>
/// 导入服务端
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MenuItemImportServer_Click(object sender, EventArgs e)
{
MenuItemImport(2);
}
private void MenuItemImport(int type)
{
ClearServer();
OpenFileDialog fileDialog = new OpenFileDialog
{
Multiselect = false,
Filter = "Config|*.json|All|*.*"
};
if (fileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
string fileName = fileDialog.FileName;
if (Utils.IsNullOrEmpty(fileName))
{
return;
}
string msg;
VmessItem vmessItem;
if (type.Equals(1))
{
vmessItem = V2rayConfigHandler.ImportFromClientConfig(fileName, out msg);
}
else
{
vmessItem = V2rayConfigHandler.ImportFromServerConfig(fileName, out msg);
}
if (vmessItem == null)
{
UI.ShowWarning(msg);
return;
}
txtAddress.Text = vmessItem.address;
txtPort.Text = vmessItem.port.ToString();
txtId.Text = vmessItem.id;
txtRemarks.Text = vmessItem.remarks;
cmbNetwork.Text = vmessItem.network;
cmbHeaderType.Text = vmessItem.headerType;
txtRequestHost.Text = vmessItem.requestHost;
txtPath.Text = vmessItem.path;
cmbStreamSecurity.Text = vmessItem.streamSecurity;
}
/// <summary>
/// 从剪贴板导入URL
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MenuItemImportClipboard_Click(object sender, EventArgs e)
{
ClearServer();
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.ShowWarning(msg);
return;
}
txtAddress.Text = vmessItem.address;
txtPort.Text = vmessItem.port.ToString();
txtId.Text = vmessItem.id;
txtRemarks.Text = vmessItem.remarks;
cmbNetwork.Text = vmessItem.network;
cmbHeaderType.Text = vmessItem.headerType;
txtRequestHost.Text = vmessItem.requestHost;
txtPath.Text = vmessItem.path;
cmbStreamSecurity.Text = vmessItem.streamSecurity;
}
#endregion
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,344 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cmbFlow.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 20</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>流控(flow)</value>
</data>
<data name="btnGUID.Text" xml:space="preserve">
<value>生成(&amp;G)</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value>
</data>
<data name="label24.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 12</value>
</data>
<data name="label24.Text" xml:space="preserve">
<value>3)QUIC 加密密钥/Kcp seed</value>
</data>
<data name="label23.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="label23.Text" xml:space="preserve">
<value>4)QUIC 加密方式</value>
</data>
<data name="label21.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 12</value>
</data>
<data name="label21.Text" xml:space="preserve">
<value>跳过证书验证(allowInsecure)</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>181, 7</value>
</data>
<data name="label9.Location" type="System.Drawing.Point, System.Drawing">
<value>353, 36</value>
</data>
<data name="label9.Size" type="System.Drawing.Size, System.Drawing">
<value>143, 12</value>
</data>
<data name="label9.Text" xml:space="preserve">
<value>*默认tcp,选错会无法连接</value>
</data>
<data name="label20.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 12</value>
</data>
<data name="label20.Text" xml:space="preserve">
<value>3)h2 host中间逗号(,)隔开</value>
</data>
<data name="txtPath.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 168</value>
</data>
<data name="cmbNetwork.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 32</value>
</data>
<data name="cmbNetwork.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 20</value>
</data>
<data name="label7.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 36</value>
</data>
<data name="label7.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 12</value>
</data>
<data name="label7.Text" xml:space="preserve">
<value>传输协议(network)</value>
</data>
<data name="label19.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 168</value>
</data>
<data name="label19.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label19.Text" xml:space="preserve">
<value>路径(path)</value>
</data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>161, 12</value>
</data>
<data name="label14.Text" xml:space="preserve">
<value>1)http host中间逗号(,)隔开</value>
</data>
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 241</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>底层传输安全(tls)</value>
</data>
<data name="cmbStreamSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 237</value>
</data>
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
<value>282, 71</value>
</data>
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
<value>197, 12</value>
</data>
<data name="label12.Text" xml:space="preserve">
<value>*tcp或kcp或QUIC伪装类型,默认none</value>
</data>
<data name="txtRequestHost.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 102</value>
</data>
<data name="txtRequestHost.Size" type="System.Drawing.Size, System.Drawing">
<value>334, 51</value>
</data>
<data name="label11.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 71</value>
</data>
<data name="label11.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="label11.Text" xml:space="preserve">
<value>伪装类型(type)</value>
</data>
<data name="label10.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 102</value>
</data>
<data name="label10.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="label10.Text" xml:space="preserve">
<value>伪装域名(host)</value>
</data>
<data name="cmbHeaderType.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 67</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>底层传输方式(transport)</value>
</data>
<data name="label8.Location" type="System.Drawing.Point, System.Drawing">
<value>353, 158</value>
</data>
<data name="label8.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label8.Text" xml:space="preserve">
<value>*非空(none)</value>
</data>
<data name="cmbSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 20</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 21</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>别名(remarks)</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>101, 12</value>
</data>
<data name="label5.Text" xml:space="preserve">
<value>加密(encryption)</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>用户ID(id)</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>端口(port)</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>地址(address)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="MenuItemImportClient.Size" type="System.Drawing.Size, System.Drawing">
<value>171, 22</value>
</data>
<data name="MenuItemImportClient.Text" xml:space="preserve">
<value>导入客户端配置</value>
</data>
<data name="MenuItemImportServer.Size" type="System.Drawing.Size, System.Drawing">
<value>171, 22</value>
</data>
<data name="MenuItemImportServer.Text" xml:space="preserve">
<value>导入服务端配置</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 6</value>
</data>
<data name="MenuItemImportClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>171, 22</value>
</data>
<data name="MenuItemImportClipboard.Text" xml:space="preserve">
<value>从剪贴板导入URL</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="MenuItem1.Enabled" type="System.Boolean, mscorlib">
<value>False</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="$this.Text" xml:space="preserve">
<value>编辑或添加[VLESS]服务器</value>
</data>
</root>

View file

@ -0,0 +1,232 @@
namespace v2rayN.Forms
{
partial class AddServer6Form
{
/// <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(AddServer6Form));
this.btnClose = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label21 = new System.Windows.Forms.Label();
this.cmbAllowInsecure = new System.Windows.Forms.ComboBox();
this.label15 = new System.Windows.Forms.Label();
this.cmbStreamSecurity = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.txtSNI = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.txtId = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtPort = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtAddress = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// 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);
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.label21);
this.groupBox1.Controls.Add(this.cmbAllowInsecure);
this.groupBox1.Controls.Add(this.label15);
this.groupBox1.Controls.Add(this.cmbStreamSecurity);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.txtSNI);
this.groupBox1.Controls.Add(this.label13);
this.groupBox1.Controls.Add(this.txtRemarks);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.txtId);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.txtPort);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtAddress);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// label21
//
resources.ApplyResources(this.label21, "label21");
this.label21.Name = "label21";
//
// cmbAllowInsecure
//
resources.ApplyResources(this.cmbAllowInsecure, "cmbAllowInsecure");
this.cmbAllowInsecure.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbAllowInsecure.FormattingEnabled = true;
this.cmbAllowInsecure.Items.AddRange(new object[] {
resources.GetString("cmbAllowInsecure.Items"),
resources.GetString("cmbAllowInsecure.Items1"),
resources.GetString("cmbAllowInsecure.Items2")});
this.cmbAllowInsecure.Name = "cmbAllowInsecure";
//
// label15
//
resources.ApplyResources(this.label15, "label15");
this.label15.Name = "label15";
//
// cmbStreamSecurity
//
resources.ApplyResources(this.cmbStreamSecurity, "cmbStreamSecurity");
this.cmbStreamSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbStreamSecurity.FormattingEnabled = true;
this.cmbStreamSecurity.Items.AddRange(new object[] {
resources.GetString("cmbStreamSecurity.Items"),
resources.GetString("cmbStreamSecurity.Items1")});
this.cmbStreamSecurity.Name = "cmbStreamSecurity";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// txtSNI
//
resources.ApplyResources(this.txtSNI, "txtSNI");
this.txtSNI.Name = "txtSNI";
//
// label13
//
resources.ApplyResources(this.label13, "label13");
this.label13.Name = "label13";
//
// txtRemarks
//
resources.ApplyResources(this.txtRemarks, "txtRemarks");
this.txtRemarks.Name = "txtRemarks";
//
// label6
//
resources.ApplyResources(this.label6, "label6");
this.label6.Name = "label6";
//
// txtId
//
resources.ApplyResources(this.txtId, "txtId");
this.txtId.Name = "txtId";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// txtPort
//
resources.ApplyResources(this.txtPort, "txtPort");
this.txtPort.Name = "txtPort";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// txtAddress
//
resources.ApplyResources(this.txtAddress, "txtAddress");
this.txtAddress.Name = "txtAddress";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
this.panel2.Name = "panel2";
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// AddServer6Form
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MinimizeBox = true;
this.Name = "AddServer6Form";
this.Load += new System.EventHandler(this.AddServer6Form_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtId;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtPort;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtAddress;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtSNI;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.ComboBox cmbStreamSecurity;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.ComboBox cmbAllowInsecure;
}
}

View file

@ -0,0 +1,108 @@
using System;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class AddServer6Form : BaseServerForm
{
public AddServer6Form()
{
InitializeComponent();
}
private void AddServer6Form_Load(object sender, EventArgs e)
{
if (EditIndex >= 0)
{
vmessItem = config.vmess[EditIndex];
BindingServer();
}
else
{
vmessItem = new VmessItem();
ClearServer();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindingServer()
{
txtAddress.Text = vmessItem.address;
txtPort.Text = vmessItem.port.ToString();
txtId.Text = vmessItem.id;
txtSNI.Text = vmessItem.sni;
txtRemarks.Text = vmessItem.remarks;
cmbStreamSecurity.Text = vmessItem.streamSecurity;
cmbAllowInsecure.Text = vmessItem.allowInsecure;
}
/// <summary>
/// 清除设置
/// </summary>
private void ClearServer()
{
txtAddress.Text = "";
txtPort.Text = "";
txtId.Text = "";
txtSNI.Text = "";
txtRemarks.Text = "";
cmbStreamSecurity.Text = "tls";
cmbAllowInsecure.Text = "";
}
private void btnOK_Click(object sender, EventArgs e)
{
string address = txtAddress.Text;
string port = txtPort.Text;
string id = txtId.Text;
string sni = txtSNI.Text;
string remarks = txtRemarks.Text;
string streamSecurity = cmbStreamSecurity.Text;
string allowInsecure = cmbAllowInsecure.Text;
if (Utils.IsNullOrEmpty(address))
{
UI.Show(UIRes.I18N("FillServerAddress"));
return;
}
if (Utils.IsNullOrEmpty(port) || !Utils.IsNumberic(port))
{
UI.Show(UIRes.I18N("FillCorrectServerPort"));
return;
}
if (Utils.IsNullOrEmpty(id))
{
UI.Show(UIRes.I18N("FillPassword"));
return;
}
vmessItem.address = address;
vmessItem.port = Utils.ToInt(port);
vmessItem.id = id;
vmessItem.sni = sni.Replace(" ", "");
vmessItem.remarks = remarks;
vmessItem.streamSecurity = streamSecurity;
vmessItem.allowInsecure = allowInsecure;
if (ConfigHandler.AddTrojanServer(ref config, vmessItem, EditIndex) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -0,0 +1,657 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>312, 185</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;txtSNI.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="label21.Text" xml:space="preserve">
<value>allowInsecure</value>
</data>
<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>Bottom</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Password</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="label21.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>groupBox1</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="&gt;&gt;cmbStreamSecurity.Name" xml:space="preserve">
<value>cmbStreamSecurity</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 27</value>
</data>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Edit or add a [Trojan] server</value>
</data>
<data name="cmbStreamSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 20</value>
</data>
<data name="txtId.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;cmbStreamSecurity.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
</data>
<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="label3.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="&gt;&gt;cmbAllowInsecure.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label21.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;txtAddress.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;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="&gt;&gt;label21.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="cmbStreamSecurity.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label13.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 91</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;cmbStreamSecurity.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;txtSNI.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;txtId.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label13.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;cmbAllowInsecure.Name" xml:space="preserve">
<value>cmbAllowInsecure</value>
</data>
<data name="&gt;&gt;txtId.Name" xml:space="preserve">
<value>txtId</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 156</value>
</data>
<data name="&gt;&gt;txtId.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.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>12, 31</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</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>AddServer6Form</value>
</data>
<data name="&gt;&gt;label15.ZOrder" xml:space="preserve">
<value>2</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>groupBox1</value>
</data>
<data name="&gt;&gt;cmbStreamSecurity.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="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 59</value>
</data>
<data name="cmbAllowInsecure.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 20</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="cmbAllowInsecure.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 60</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;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="cmbAllowInsecure.Items" xml:space="preserve">
<value />
</data>
<data name="txtSNI.TabIndex" type="System.Int32, mscorlib">
<value>23</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>panel2</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 10</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="&gt;&gt;txtId.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="label15.TabIndex" type="System.Int32, mscorlib">
<value>26</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="&gt;&gt;txtSNI.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;label15.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;txtSNI.Name" xml:space="preserve">
<value>txtSNI</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 12</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 93</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="&gt;&gt;label13.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="cmbAllowInsecure.Items1" xml:space="preserve">
<value>true</value>
</data>
<data name="txtAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</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="panel1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;label13.Name" xml:space="preserve">
<value>label13</value>
</data>
<data name="txtSNI.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseServerForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Server port</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="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 17</value>
</data>
<data name="&gt;&gt;label21.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="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 231</value>
</data>
<data name="cmbStreamSecurity.Items" xml:space="preserve">
<value>tls</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="label21.TabIndex" type="System.Int32, mscorlib">
<value>33</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>12, 189</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cmbStreamSecurity.Items1" xml:space="preserve">
<value>xtls</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="&gt;&gt;label21.Name" xml:space="preserve">
<value>label21</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Server address</value>
</data>
<data name="cmbAllowInsecure.Items2" xml:space="preserve">
<value>false</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>TLS</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="&gt;&gt;cmbAllowInsecure.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="cmbStreamSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 185</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="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>14</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;cmbAllowInsecure.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 62</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>547, 291</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;label21.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 221</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="&gt;&gt;label15.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="label21.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>337, 125</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>7</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 121</value>
</data>
<data name="txtId.PasswordChar" type="System.Char, mscorlib" xml:space="preserve">
<value>*</value>
</data>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 12</value>
</data>
<data name="label21.Location" type="System.Drawing.Point, System.Drawing">
<value>224, 189</value>
</data>
<data name="&gt;&gt;txtAddress.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label15.Name" xml:space="preserve">
<value>label15</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="txtSNI.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 152</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 125</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>SNI</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>3</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

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label21.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 12</value>
</data>
<data name="label21.Text" xml:space="preserve">
<value>跳过证书验证(allowInsecure)</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>406, 185</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>底层传输安全(tls)</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="cmbStreamSecurity.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>别名(remarks)</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>密码</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>服务器端口</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>服务器地址</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>编辑或添加[Trojan]服务器</value>
</data>
</root>

View file

@ -37,10 +37,15 @@
this.label24 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.panTlsMore = new System.Windows.Forms.Panel();
this.txtSNI = new System.Windows.Forms.TextBox();
this.label22 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.cmbAllowInsecure = new System.Windows.Forms.ComboBox();
this.label9 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.txtPath = new System.Windows.Forms.TextBox();
this.cmbNetwork = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
@ -53,10 +58,7 @@
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.cmbHeaderType = new System.Windows.Forms.ComboBox();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.cmbNetwork = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.cmbSecurity = new System.Windows.Forms.ComboBox();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
@ -99,10 +101,7 @@
this.groupBox1.Controls.Add(this.btnGUID);
this.groupBox1.Controls.Add(this.label13);
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Controls.Add(this.label9);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.cmbNetwork);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.cmbSecurity);
this.groupBox1.Controls.Add(this.txtRemarks);
this.groupBox1.Controls.Add(this.label6);
@ -136,8 +135,11 @@
this.groupBox2.Controls.Add(this.label24);
this.groupBox2.Controls.Add(this.label23);
this.groupBox2.Controls.Add(this.panTlsMore);
this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.label20);
this.groupBox2.Controls.Add(this.txtPath);
this.groupBox2.Controls.Add(this.cmbNetwork);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.label19);
this.groupBox2.Controls.Add(this.label18);
this.groupBox2.Controls.Add(this.label17);
@ -166,10 +168,22 @@
// panTlsMore
//
resources.ApplyResources(this.panTlsMore, "panTlsMore");
this.panTlsMore.Controls.Add(this.txtSNI);
this.panTlsMore.Controls.Add(this.label22);
this.panTlsMore.Controls.Add(this.label21);
this.panTlsMore.Controls.Add(this.cmbAllowInsecure);
this.panTlsMore.Name = "panTlsMore";
//
// txtSNI
//
resources.ApplyResources(this.txtSNI, "txtSNI");
this.txtSNI.Name = "txtSNI";
//
// label22
//
resources.ApplyResources(this.label22, "label22");
this.label22.Name = "label22";
//
// label21
//
resources.ApplyResources(this.label21, "label21");
@ -186,6 +200,11 @@
resources.GetString("cmbAllowInsecure.Items2")});
this.cmbAllowInsecure.Name = "cmbAllowInsecure";
//
// label9
//
resources.ApplyResources(this.label9, "label9");
this.label9.Name = "label9";
//
// label20
//
resources.ApplyResources(this.label20, "label20");
@ -196,6 +215,25 @@
resources.ApplyResources(this.txtPath, "txtPath");
this.txtPath.Name = "txtPath";
//
// cmbNetwork
//
resources.ApplyResources(this.cmbNetwork, "cmbNetwork");
this.cmbNetwork.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbNetwork.FormattingEnabled = true;
this.cmbNetwork.Items.AddRange(new object[] {
resources.GetString("cmbNetwork.Items"),
resources.GetString("cmbNetwork.Items1"),
resources.GetString("cmbNetwork.Items2"),
resources.GetString("cmbNetwork.Items3"),
resources.GetString("cmbNetwork.Items4")});
this.cmbNetwork.Name = "cmbNetwork";
this.cmbNetwork.SelectedIndexChanged += new System.EventHandler(this.cmbNetwork_SelectedIndexChanged);
//
// label7
//
resources.ApplyResources(this.label7, "label7");
this.label7.Name = "label7";
//
// label19
//
resources.ApplyResources(this.label19, "label19");
@ -272,35 +310,11 @@
resources.GetString("cmbHeaderType.Items6")});
this.cmbHeaderType.Name = "cmbHeaderType";
//
// label9
//
resources.ApplyResources(this.label9, "label9");
this.label9.Name = "label9";
//
// label8
//
resources.ApplyResources(this.label8, "label8");
this.label8.Name = "label8";
//
// cmbNetwork
//
resources.ApplyResources(this.cmbNetwork, "cmbNetwork");
this.cmbNetwork.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbNetwork.FormattingEnabled = true;
this.cmbNetwork.Items.AddRange(new object[] {
resources.GetString("cmbNetwork.Items"),
resources.GetString("cmbNetwork.Items1"),
resources.GetString("cmbNetwork.Items2"),
resources.GetString("cmbNetwork.Items3"),
resources.GetString("cmbNetwork.Items4")});
this.cmbNetwork.Name = "cmbNetwork";
this.cmbNetwork.SelectedIndexChanged += new System.EventHandler(this.cmbNetwork_SelectedIndexChanged);
//
// label7
//
resources.ApplyResources(this.label7, "label7");
this.label7.Name = "label7";
//
// cmbSecurity
//
resources.ApplyResources(this.cmbSecurity, "cmbSecurity");
@ -504,5 +518,7 @@
private System.Windows.Forms.Panel panTlsMore;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.TextBox txtSNI;
}
}

View file

@ -5,10 +5,8 @@ using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class AddServerForm : BaseForm
{
public int EditIndex { get; set; }
VmessItem vmessItem = null;
public partial class AddServerForm : BaseServerForm
{
public AddServerForm()
{
@ -47,6 +45,7 @@ namespace v2rayN.Forms
txtPath.Text = vmessItem.path;
cmbStreamSecurity.Text = vmessItem.streamSecurity;
cmbAllowInsecure.Text = vmessItem.allowInsecure;
txtSNI.Text = vmessItem.sni;
}
@ -68,6 +67,7 @@ namespace v2rayN.Forms
cmbStreamSecurity.Text = "";
cmbAllowInsecure.Text = "";
txtPath.Text = "";
txtSNI.Text = "";
}
@ -124,6 +124,7 @@ namespace v2rayN.Forms
string path = txtPath.Text;
string streamSecurity = cmbStreamSecurity.Text;
string allowInsecure = cmbAllowInsecure.Text;
string sni = txtSNI.Text;
if (Utils.IsNullOrEmpty(address))
{
@ -159,6 +160,7 @@ namespace v2rayN.Forms
vmessItem.path = path.Replace(" ", "");
vmessItem.streamSecurity = streamSecurity;
vmessItem.allowInsecure = allowInsecure;
vmessItem.sni = sni;
if (ConfigHandler.AddServer(ref config, vmessItem, EditIndex) == 0)
{
@ -180,6 +182,18 @@ namespace v2rayN.Forms
this.DialogResult = DialogResult.Cancel;
}
private void cmbStreamSecurity_SelectedIndexChanged(object sender, EventArgs e)
{
string security = cmbStreamSecurity.Text;
if (Utils.IsNullOrEmpty(security))
{
panTlsMore.Hide();
}
else
{
panTlsMore.Show();
}
}
#region /
@ -258,7 +272,7 @@ namespace v2rayN.Forms
{
ClearServer();
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.ShowWarning(msg);
@ -278,17 +292,5 @@ namespace v2rayN.Forms
}
#endregion
private void cmbStreamSecurity_SelectedIndexChanged(object sender, EventArgs e)
{
string security = cmbStreamSecurity.Text;
if (Utils.IsNullOrEmpty(security))
{
panTlsMore.Hide();
}
else
{
panTlsMore.Show();
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -120,24 +120,18 @@
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="btnGUID.Text" xml:space="preserve">
<value>生成(&amp;G)</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value>
</data>
<data name="groupBox2.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="label24.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
<value>149, 12</value>
</data>
<data name="label24.Text" xml:space="preserve">
<value>3)QUIC 加密密钥</value>
<value>3)QUIC 加密密钥/Kcp seed</value>
</data>
<data name="label23.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
@ -146,13 +140,22 @@
<value>4)QUIC 加密方式</value>
</data>
<data name="label21.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 12</value>
<value>167, 12</value>
</data>
<data name="label21.Text" xml:space="preserve">
<value>跳过证书验证(allowInsecure)</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>223, 7</value>
<value>180, 7</value>
</data>
<data name="label9.Location" type="System.Drawing.Point, System.Drawing">
<value>350, 36</value>
</data>
<data name="label9.Size" type="System.Drawing.Size, System.Drawing">
<value>143, 12</value>
</data>
<data name="label9.Text" xml:space="preserve">
<value>*默认tcp,选错会无法连接</value>
</data>
<data name="label20.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 12</value>
@ -160,6 +163,27 @@
<data name="label20.Text" xml:space="preserve">
<value>3)h2 host中间逗号(,)隔开</value>
</data>
<data name="txtPath.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 168</value>
</data>
<data name="cmbNetwork.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 32</value>
</data>
<data name="cmbNetwork.Size" type="System.Drawing.Size, System.Drawing">
<value>211, 20</value>
</data>
<data name="label7.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 36</value>
</data>
<data name="label7.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 12</value>
</data>
<data name="label7.Text" xml:space="preserve">
<value>传输协议(network)</value>
</data>
<data name="label19.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 168</value>
</data>
<data name="label19.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
@ -172,11 +196,20 @@
<data name="label14.Text" xml:space="preserve">
<value>1)http host中间逗号(,)隔开</value>
</data>
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 237</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
<value>107, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>底层传输安全</value>
<value>底层传输安全(tls)</value>
</data>
<data name="cmbStreamSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 237</value>
</data>
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
<value>282, 71</value>
</data>
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
<value>197, 12</value>
@ -185,28 +218,34 @@
<value>*tcp或kcp或QUIC伪装类型,默认none</value>
</data>
<data name="txtRequestHost.Location" type="System.Drawing.Point, System.Drawing">
<value>124, 58</value>
<value>127, 102</value>
</data>
<data name="txtRequestHost.Size" type="System.Drawing.Size, System.Drawing">
<value>334, 51</value>
</data>
<data name="label11.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 71</value>
</data>
<data name="label11.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="label11.Text" xml:space="preserve">
<value>伪装类型(type)</value>
</data>
<data name="label10.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 102</value>
</data>
<data name="label10.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="label10.Text" xml:space="preserve">
<value>伪装域名(host)</value>
</data>
<data name="label9.Size" type="System.Drawing.Size, System.Drawing">
<value>143, 12</value>
<data name="cmbHeaderType.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 67</value>
</data>
<data name="label9.Text" xml:space="preserve">
<value>*默认tcp,选错会无法连接</value>
<data name="groupBox2.Text" xml:space="preserve">
<value>底层传输方式(transport)</value>
</data>
<data name="label8.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
@ -214,18 +253,6 @@
<data name="label8.Text" xml:space="preserve">
<value>*随便选,建议(auto)</value>
</data>
<data name="cmbNetwork.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 171</value>
</data>
<data name="cmbNetwork.Size" type="System.Drawing.Size, System.Drawing">
<value>211, 20</value>
</data>
<data name="label7.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 12</value>
</data>
<data name="label7.Text" xml:space="preserve">
<value>传输协议(network)</value>
</data>
<data name="cmbSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 143</value>
</data>
@ -268,15 +295,12 @@
<data name="label1.Text" xml:space="preserve">
<value>地址(address)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</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="MenuItemImportClient.Size" type="System.Drawing.Size, System.Drawing">
<value>171, 22</value>
</data>
@ -298,6 +322,12 @@
<data name="MenuItemImportClipboard.Text" xml:space="preserve">
<value>从剪贴板导入URL</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="$this.Text" xml:space="preserve">
<value>编辑或添加[VMess]服务器</value>
</data>

View file

@ -0,0 +1,51 @@
namespace v2rayN.Forms
{
partial class BaseServerForm
{
/// <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(BaseServerForm));
this.SuspendLayout();
//
// BaseServerForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "BaseServerForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "BaseServerForm";
this.ResumeLayout(false);
}
#endregion
}
}

View file

@ -0,0 +1,18 @@
using System;
using System.Windows.Forms;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class BaseServerForm : BaseForm
{
public int EditIndex { get; set; }
protected VmessItem vmessItem = null;
public BaseServerForm()
{
InitializeComponent();
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -34,8 +34,10 @@
this.lvServers = new v2rayN.Base.ListViewFlickerFree();
this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuAddVmessServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddVlessServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddShadowsocksServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddSocksServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddTrojanServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddCustomServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddServers = new System.Windows.Forms.ToolStripMenuItem();
this.menuScanScreen = new System.Windows.Forms.ToolStripMenuItem();
@ -56,6 +58,7 @@
this.menuRealPingServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuSpeedServer = new System.Windows.Forms.ToolStripMenuItem();
this.tsbTestMe = new System.Windows.Forms.ToolStripMenuItem();
this.menuClearServerStatistics = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.menuExport2ClientConfig = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2ServerConfig = new System.Windows.Forms.ToolStripMenuItem();
@ -66,17 +69,14 @@
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.menuNotEnabledHttp = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepClear = new System.Windows.Forms.ToolStripMenuItem();
this.menuGlobal = new System.Windows.Forms.ToolStripMenuItem();
this.menuGlobalPAC = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeep = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepPAC = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepPACNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuRoutings = new System.Windows.Forms.ToolStripMenuItem();
this.menuServers = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.menuAddServers2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuScanScreen2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuCopyPACUrl = new System.Windows.Forms.ToolStripMenuItem();
this.menuUpdateSubscriptions = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.menuExit = new System.Windows.Forms.ToolStripMenuItem();
@ -84,6 +84,11 @@
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtMsgBox = new System.Windows.Forms.TextBox();
this.cmsMsgBox = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuMsgBoxSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopy = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopyAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxAddRoutingRule = new System.Windows.Forms.ToolStripMenuItem();
this.ssMain = new System.Windows.Forms.StatusStrip();
this.toolSslSocksPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslSocksPort = new System.Windows.Forms.ToolStripStatusLabel();
@ -91,8 +96,6 @@
this.toolSslHttpPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslHttpPort = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslPacPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslPacPort = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank3 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslServerSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank4 = new System.Windows.Forms.ToolStripStatusLabel();
@ -104,16 +107,16 @@
this.tsbSubUpdate = new System.Windows.Forms.ToolStripMenuItem();
this.tsbQRCodeSwitch = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.tsbOptionSetting = new System.Windows.Forms.ToolStripButton();
this.tsbSetting = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbOptionSetting = new System.Windows.Forms.ToolStripMenuItem();
this.tsbRoutingSetting = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.tsbReload = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.tsbCheckUpdate = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbCheckUpdateN = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateCore = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdatePACList = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.tsbCheckClearPACList = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateXrayCore = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.tsbHelp = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbAbout = new System.Windows.Forms.ToolStripMenuItem();
@ -132,6 +135,7 @@
this.cmsMain.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.cmsMsgBox.SuspendLayout();
this.ssMain.SuspendLayout();
this.tsMain.SuspendLayout();
this.SuspendLayout();
@ -144,17 +148,19 @@
//
// scMain.Panel1
//
resources.ApplyResources(this.scMain.Panel1, "scMain.Panel1");
this.scMain.Panel1.Controls.Add(this.lvServers);
//
// scMain.Panel2
//
resources.ApplyResources(this.scMain.Panel2, "scMain.Panel2");
this.scMain.Panel2.Controls.Add(this.qrCodeControl);
this.scMain.TabStop = false;
//
// lvServers
//
this.lvServers.ContextMenuStrip = this.cmsLv;
resources.ApplyResources(this.lvServers, "lvServers");
this.lvServers.ContextMenuStrip = this.cmsLv;
this.lvServers.FullRowSelect = true;
this.lvServers.GridLines = true;
this.lvServers.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
@ -173,11 +179,14 @@
//
// cmsLv
//
resources.ApplyResources(this.cmsLv, "cmsLv");
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuAddVmessServer,
this.menuAddVlessServer,
this.menuAddShadowsocksServer,
this.menuAddSocksServer,
this.menuAddTrojanServer,
this.menuAddCustomServer,
this.menuAddServers,
this.menuScanScreen,
@ -198,6 +207,7 @@
this.menuRealPingServer,
this.menuSpeedServer,
this.tsbTestMe,
this.menuClearServerStatistics,
this.toolStripSeparator6,
this.menuExport2ClientConfig,
this.menuExport2ServerConfig,
@ -205,177 +215,194 @@
this.menuExport2SubContent});
this.cmsLv.Name = "cmsLv";
this.cmsLv.OwnerItem = this.tsbServer;
resources.ApplyResources(this.cmsLv, "cmsLv");
//
// menuAddVmessServer
//
this.menuAddVmessServer.Name = "menuAddVmessServer";
resources.ApplyResources(this.menuAddVmessServer, "menuAddVmessServer");
this.menuAddVmessServer.Name = "menuAddVmessServer";
this.menuAddVmessServer.Click += new System.EventHandler(this.menuAddVmessServer_Click);
//
// menuAddVlessServer
//
resources.ApplyResources(this.menuAddVlessServer, "menuAddVlessServer");
this.menuAddVlessServer.Name = "menuAddVlessServer";
this.menuAddVlessServer.Click += new System.EventHandler(this.menuAddVlessServer_Click);
//
// menuAddShadowsocksServer
//
this.menuAddShadowsocksServer.Name = "menuAddShadowsocksServer";
resources.ApplyResources(this.menuAddShadowsocksServer, "menuAddShadowsocksServer");
this.menuAddShadowsocksServer.Name = "menuAddShadowsocksServer";
this.menuAddShadowsocksServer.Click += new System.EventHandler(this.menuAddShadowsocksServer_Click);
//
// menuAddSocksServer
//
this.menuAddSocksServer.Name = "menuAddSocksServer";
resources.ApplyResources(this.menuAddSocksServer, "menuAddSocksServer");
this.menuAddSocksServer.Name = "menuAddSocksServer";
this.menuAddSocksServer.Click += new System.EventHandler(this.menuAddSocksServer_Click);
//
// menuAddTrojanServer
//
resources.ApplyResources(this.menuAddTrojanServer, "menuAddTrojanServer");
this.menuAddTrojanServer.Name = "menuAddTrojanServer";
this.menuAddTrojanServer.Click += new System.EventHandler(this.menuAddTrojanServer_Click);
//
// menuAddCustomServer
//
this.menuAddCustomServer.Name = "menuAddCustomServer";
resources.ApplyResources(this.menuAddCustomServer, "menuAddCustomServer");
this.menuAddCustomServer.Name = "menuAddCustomServer";
this.menuAddCustomServer.Click += new System.EventHandler(this.menuAddCustomServer_Click);
//
// menuAddServers
//
this.menuAddServers.Name = "menuAddServers";
resources.ApplyResources(this.menuAddServers, "menuAddServers");
this.menuAddServers.Name = "menuAddServers";
this.menuAddServers.Click += new System.EventHandler(this.menuAddServers_Click);
//
// menuScanScreen
//
this.menuScanScreen.Name = "menuScanScreen";
resources.ApplyResources(this.menuScanScreen, "menuScanScreen");
this.menuScanScreen.Name = "menuScanScreen";
this.menuScanScreen.Click += new System.EventHandler(this.menuScanScreen_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
this.toolStripSeparator1.Name = "toolStripSeparator1";
//
// menuRemoveServer
//
this.menuRemoveServer.Name = "menuRemoveServer";
resources.ApplyResources(this.menuRemoveServer, "menuRemoveServer");
this.menuRemoveServer.Name = "menuRemoveServer";
this.menuRemoveServer.Click += new System.EventHandler(this.menuRemoveServer_Click);
//
// menuRemoveDuplicateServer
//
this.menuRemoveDuplicateServer.Name = "menuRemoveDuplicateServer";
resources.ApplyResources(this.menuRemoveDuplicateServer, "menuRemoveDuplicateServer");
this.menuRemoveDuplicateServer.Name = "menuRemoveDuplicateServer";
this.menuRemoveDuplicateServer.Click += new System.EventHandler(this.menuRemoveDuplicateServer_Click);
//
// menuCopyServer
//
this.menuCopyServer.Name = "menuCopyServer";
resources.ApplyResources(this.menuCopyServer, "menuCopyServer");
this.menuCopyServer.Name = "menuCopyServer";
this.menuCopyServer.Click += new System.EventHandler(this.menuCopyServer_Click);
//
// menuSetDefaultServer
//
this.menuSetDefaultServer.Name = "menuSetDefaultServer";
resources.ApplyResources(this.menuSetDefaultServer, "menuSetDefaultServer");
this.menuSetDefaultServer.Name = "menuSetDefaultServer";
this.menuSetDefaultServer.Click += new System.EventHandler(this.menuSetDefaultServer_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
this.toolStripSeparator3.Name = "toolStripSeparator3";
//
// menuMoveTop
//
this.menuMoveTop.Name = "menuMoveTop";
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
this.menuMoveTop.Name = "menuMoveTop";
this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click);
//
// menuMoveUp
//
this.menuMoveUp.Name = "menuMoveUp";
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
this.menuMoveUp.Name = "menuMoveUp";
this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click);
//
// menuMoveDown
//
this.menuMoveDown.Name = "menuMoveDown";
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
this.menuMoveDown.Name = "menuMoveDown";
this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click);
//
// menuMoveBottom
//
this.menuMoveBottom.Name = "menuMoveBottom";
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
this.menuMoveBottom.Name = "menuMoveBottom";
this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click);
//
// menuSelectAll
//
this.menuSelectAll.Name = "menuSelectAll";
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Name = "menuSelectAll";
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
resources.ApplyResources(this.toolStripSeparator9, "toolStripSeparator9");
this.toolStripSeparator9.Name = "toolStripSeparator9";
//
// menuPingServer
//
this.menuPingServer.Name = "menuPingServer";
resources.ApplyResources(this.menuPingServer, "menuPingServer");
this.menuPingServer.Name = "menuPingServer";
this.menuPingServer.Click += new System.EventHandler(this.menuPingServer_Click);
//
// menuTcpingServer
//
this.menuTcpingServer.Name = "menuTcpingServer";
resources.ApplyResources(this.menuTcpingServer, "menuTcpingServer");
this.menuTcpingServer.Name = "menuTcpingServer";
this.menuTcpingServer.Click += new System.EventHandler(this.menuTcpingServer_Click);
//
// menuRealPingServer
//
this.menuRealPingServer.Name = "menuRealPingServer";
resources.ApplyResources(this.menuRealPingServer, "menuRealPingServer");
this.menuRealPingServer.Name = "menuRealPingServer";
this.menuRealPingServer.Click += new System.EventHandler(this.menuRealPingServer_Click);
//
// menuSpeedServer
//
this.menuSpeedServer.Name = "menuSpeedServer";
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
this.menuSpeedServer.Name = "menuSpeedServer";
this.menuSpeedServer.Click += new System.EventHandler(this.menuSpeedServer_Click);
//
// tsbTestMe
//
this.tsbTestMe.Name = "tsbTestMe";
resources.ApplyResources(this.tsbTestMe, "tsbTestMe");
this.tsbTestMe.Name = "tsbTestMe";
this.tsbTestMe.Click += new System.EventHandler(this.tsbTestMe_Click);
//
// menuClearServerStatistics
//
resources.ApplyResources(this.menuClearServerStatistics, "menuClearServerStatistics");
this.menuClearServerStatistics.Name = "menuClearServerStatistics";
this.menuClearServerStatistics.Click += new System.EventHandler(this.menuClearStatistic_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
this.toolStripSeparator6.Name = "toolStripSeparator6";
//
// menuExport2ClientConfig
//
this.menuExport2ClientConfig.Name = "menuExport2ClientConfig";
resources.ApplyResources(this.menuExport2ClientConfig, "menuExport2ClientConfig");
this.menuExport2ClientConfig.Name = "menuExport2ClientConfig";
this.menuExport2ClientConfig.Click += new System.EventHandler(this.menuExport2ClientConfig_Click);
//
// menuExport2ServerConfig
//
this.menuExport2ServerConfig.Name = "menuExport2ServerConfig";
resources.ApplyResources(this.menuExport2ServerConfig, "menuExport2ServerConfig");
this.menuExport2ServerConfig.Name = "menuExport2ServerConfig";
this.menuExport2ServerConfig.Click += new System.EventHandler(this.menuExport2ServerConfig_Click);
//
// menuExport2ShareUrl
//
this.menuExport2ShareUrl.Name = "menuExport2ShareUrl";
resources.ApplyResources(this.menuExport2ShareUrl, "menuExport2ShareUrl");
this.menuExport2ShareUrl.Name = "menuExport2ShareUrl";
this.menuExport2ShareUrl.Click += new System.EventHandler(this.menuExport2ShareUrl_Click);
//
// menuExport2SubContent
//
this.menuExport2SubContent.Name = "menuExport2SubContent";
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
this.menuExport2SubContent.Name = "menuExport2SubContent";
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
//
// tsbServer
//
resources.ApplyResources(this.tsbServer, "tsbServer");
this.tsbServer.DropDown = this.cmsLv;
this.tsbServer.Image = global::v2rayN.Properties.Resources.server;
resources.ApplyResources(this.tsbServer, "tsbServer");
this.tsbServer.Name = "tsbServer";
//
// qrCodeControl
@ -385,20 +412,21 @@
//
// notifyMain
//
this.notifyMain.ContextMenuStrip = this.cmsMain;
resources.ApplyResources(this.notifyMain, "notifyMain");
this.notifyMain.ContextMenuStrip = this.cmsMain;
this.notifyMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyMain_MouseClick);
//
// cmsMain
//
this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20);
resources.ApplyResources(this.cmsMain, "cmsMain");
this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuSysAgentMode,
this.menuRoutings,
this.menuServers,
this.toolStripSeparator13,
this.menuAddServers2,
this.menuScanScreen2,
this.menuCopyPACUrl,
this.menuUpdateSubscriptions,
this.toolStripSeparator2,
this.menuExit});
@ -409,97 +437,73 @@
//
// menuSysAgentMode
//
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuNotEnabledHttp,
this.menuGlobal,
this.menuGlobalPAC,
this.menuKeep,
this.menuKeepPAC,
this.menuKeepNothing,
this.menuKeepPACNothing});
this.menuSysAgentMode.Name = "menuSysAgentMode";
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuKeepClear,
this.menuGlobal,
this.menuKeepNothing});
this.menuSysAgentMode.Name = "menuSysAgentMode";
//
// menuNotEnabledHttp
// menuKeepClear
//
this.menuNotEnabledHttp.Name = "menuNotEnabledHttp";
resources.ApplyResources(this.menuNotEnabledHttp, "menuNotEnabledHttp");
this.menuNotEnabledHttp.Click += new System.EventHandler(this.menuNotEnabledHttp_Click);
resources.ApplyResources(this.menuKeepClear, "menuKeepClear");
this.menuKeepClear.Name = "menuKeepClear";
this.menuKeepClear.Click += new System.EventHandler(this.menuKeepClear_Click);
//
// menuGlobal
//
this.menuGlobal.Name = "menuGlobal";
resources.ApplyResources(this.menuGlobal, "menuGlobal");
this.menuGlobal.Name = "menuGlobal";
this.menuGlobal.Click += new System.EventHandler(this.menuGlobal_Click);
//
// menuGlobalPAC
//
this.menuGlobalPAC.Name = "menuGlobalPAC";
resources.ApplyResources(this.menuGlobalPAC, "menuGlobalPAC");
this.menuGlobalPAC.Click += new System.EventHandler(this.menuGlobalPAC_Click);
//
// menuKeep
//
this.menuKeep.Name = "menuKeep";
resources.ApplyResources(this.menuKeep, "menuKeep");
this.menuKeep.Click += new System.EventHandler(this.menuKeep_Click);
//
// menuKeepPAC
//
this.menuKeepPAC.Name = "menuKeepPAC";
resources.ApplyResources(this.menuKeepPAC, "menuKeepPAC");
this.menuKeepPAC.Click += new System.EventHandler(this.menuKeepPAC_Click);
//
// menuKeepNothing
//
this.menuKeepNothing.Name = "menuKeepNothing";
resources.ApplyResources(this.menuKeepNothing, "menuKeepNothing");
this.menuKeepNothing.Name = "menuKeepNothing";
this.menuKeepNothing.Click += new System.EventHandler(this.menuKeepNothing_Click);
//
// menuKeepPACNothing
// menuRoutings
//
this.menuKeepPACNothing.Name = "menuKeepPACNothing";
resources.ApplyResources(this.menuKeepPACNothing, "menuKeepPACNothing");
this.menuKeepPACNothing.Click += new System.EventHandler(this.menuKeepPACNothing_Click);
resources.ApplyResources(this.menuRoutings, "menuRoutings");
this.menuRoutings.Name = "menuRoutings";
//
// menuServers
//
this.menuServers.Name = "menuServers";
resources.ApplyResources(this.menuServers, "menuServers");
this.menuServers.Name = "menuServers";
//
// toolStripSeparator13
//
resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13");
this.toolStripSeparator13.Name = "toolStripSeparator13";
//
// menuAddServers2
//
this.menuAddServers2.Name = "menuAddServers2";
resources.ApplyResources(this.menuAddServers2, "menuAddServers2");
this.menuAddServers2.Name = "menuAddServers2";
this.menuAddServers2.Click += new System.EventHandler(this.menuAddServers_Click);
//
// menuScanScreen2
//
this.menuScanScreen2.Name = "menuScanScreen2";
resources.ApplyResources(this.menuScanScreen2, "menuScanScreen2");
this.menuScanScreen2.Name = "menuScanScreen2";
this.menuScanScreen2.Click += new System.EventHandler(this.menuScanScreen_Click);
//
// menuCopyPACUrl
//
this.menuCopyPACUrl.Name = "menuCopyPACUrl";
resources.ApplyResources(this.menuCopyPACUrl, "menuCopyPACUrl");
this.menuCopyPACUrl.Click += new System.EventHandler(this.menuCopyPACUrl_Click);
//
// menuUpdateSubscriptions
//
this.menuUpdateSubscriptions.Name = "menuUpdateSubscriptions";
resources.ApplyResources(this.menuUpdateSubscriptions, "menuUpdateSubscriptions");
this.menuUpdateSubscriptions.Name = "menuUpdateSubscriptions";
this.menuUpdateSubscriptions.Click += new System.EventHandler(this.menuUpdateSubscriptions_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
this.toolStripSeparator2.Name = "toolStripSeparator2";
//
// menuExit
//
this.menuExit.Name = "menuExit";
resources.ApplyResources(this.menuExit, "menuExit");
this.menuExit.Name = "menuExit";
this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
//
// bgwScan
@ -510,30 +514,68 @@
//
// groupBox1
//
this.groupBox1.Controls.Add(this.scMain);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.scMain);
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.txtMsgBox);
this.groupBox2.Controls.Add(this.ssMain);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// txtMsgBox
//
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52)))));
this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.ContextMenuStrip = this.cmsMsgBox;
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
this.txtMsgBox.Name = "txtMsgBox";
this.txtMsgBox.ReadOnly = true;
this.txtMsgBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtMsgBox_KeyDown);
//
// cmsMsgBox
//
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
this.cmsMsgBox.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMsgBoxSelectAll,
this.menuMsgBoxCopy,
this.menuMsgBoxCopyAll,
this.menuMsgBoxAddRoutingRule});
this.cmsMsgBox.Name = "cmsMsgBox";
//
// menuMsgBoxSelectAll
//
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
this.menuMsgBoxSelectAll.Name = "menuMsgBoxSelectAll";
this.menuMsgBoxSelectAll.Click += new System.EventHandler(this.menuMsgBoxSelectAll_Click);
//
// menuMsgBoxCopy
//
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
this.menuMsgBoxCopy.Name = "menuMsgBoxCopy";
this.menuMsgBoxCopy.Click += new System.EventHandler(this.menuMsgBoxCopy_Click);
//
// menuMsgBoxCopyAll
//
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
this.menuMsgBoxCopyAll.Name = "menuMsgBoxCopyAll";
this.menuMsgBoxCopyAll.Click += new System.EventHandler(this.menuMsgBoxCopyAll_Click);
//
// menuMsgBoxAddRoutingRule
//
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
this.menuMsgBoxAddRoutingRule.Name = "menuMsgBoxAddRoutingRule";
this.menuMsgBoxAddRoutingRule.Click += new System.EventHandler(this.menuMsgBoxAddRoutingRule_Click);
//
// ssMain
//
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolSslSocksPortLab,
this.toolSslSocksPort,
@ -541,12 +583,9 @@
this.toolSslHttpPortLab,
this.toolSslHttpPort,
this.toolSslBlank2,
this.toolSslPacPortLab,
this.toolSslPacPort,
this.toolSslBlank3,
this.toolSslServerSpeed,
this.toolSslBlank4});
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.Name = "ssMain";
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
//
@ -557,8 +596,8 @@
//
// toolSslSocksPort
//
this.toolSslSocksPort.Name = "toolSslSocksPort";
resources.ApplyResources(this.toolSslSocksPort, "toolSslSocksPort");
this.toolSslSocksPort.Name = "toolSslSocksPort";
//
// toolSslBlank1
//
@ -573,8 +612,8 @@
//
// toolSslHttpPort
//
this.toolSslHttpPort.Name = "toolSslHttpPort";
resources.ApplyResources(this.toolSslHttpPort, "toolSslHttpPort");
this.toolSslHttpPort.Name = "toolSslHttpPort";
//
// toolSslBlank2
//
@ -582,16 +621,6 @@
this.toolSslBlank2.Name = "toolSslBlank2";
this.toolSslBlank2.Spring = true;
//
// toolSslPacPortLab
//
resources.ApplyResources(this.toolSslPacPortLab, "toolSslPacPortLab");
this.toolSslPacPortLab.Name = "toolSslPacPortLab";
//
// toolSslPacPort
//
this.toolSslPacPort.Name = "toolSslPacPort";
resources.ApplyResources(this.toolSslPacPort, "toolSslPacPort");
//
// toolSslBlank3
//
resources.ApplyResources(this.toolSslBlank3, "toolSslBlank3");
@ -606,8 +635,8 @@
//
// toolSslBlank4
//
this.toolSslBlank4.Name = "toolSslBlank4";
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
this.toolSslBlank4.Name = "toolSslBlank4";
//
// panel1
//
@ -616,6 +645,7 @@
//
// tsMain
//
resources.ApplyResources(this.tsMain, "tsMain");
this.tsMain.ImageScalingSize = new System.Drawing.Size(32, 32);
this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbServer,
@ -623,7 +653,7 @@
this.tsbSub,
this.tsbQRCodeSwitch,
this.toolStripSeparator8,
this.tsbOptionSetting,
this.tsbSetting,
this.toolStripSeparator5,
this.tsbReload,
this.toolStripSeparator7,
@ -633,61 +663,74 @@
this.tsbPromotion,
this.toolStripSeparator11,
this.tsbClose});
resources.ApplyResources(this.tsMain, "tsMain");
this.tsMain.Name = "tsMain";
this.tsMain.TabStop = true;
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
this.toolStripSeparator4.Name = "toolStripSeparator4";
//
// tsbSub
//
resources.ApplyResources(this.tsbSub, "tsbSub");
this.tsbSub.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbSubSetting,
this.tsbSubUpdate});
this.tsbSub.Image = global::v2rayN.Properties.Resources.sub;
resources.ApplyResources(this.tsbSub, "tsbSub");
this.tsbSub.Name = "tsbSub";
//
// tsbSubSetting
//
this.tsbSubSetting.Name = "tsbSubSetting";
resources.ApplyResources(this.tsbSubSetting, "tsbSubSetting");
this.tsbSubSetting.Name = "tsbSubSetting";
this.tsbSubSetting.Click += new System.EventHandler(this.tsbSubSetting_Click);
//
// tsbSubUpdate
//
this.tsbSubUpdate.Name = "tsbSubUpdate";
resources.ApplyResources(this.tsbSubUpdate, "tsbSubUpdate");
this.tsbSubUpdate.Name = "tsbSubUpdate";
this.tsbSubUpdate.Click += new System.EventHandler(this.tsbSubUpdate_Click);
//
// tsbQRCodeSwitch
//
resources.ApplyResources(this.tsbQRCodeSwitch, "tsbQRCodeSwitch");
this.tsbQRCodeSwitch.CheckOnClick = true;
this.tsbQRCodeSwitch.ForeColor = System.Drawing.Color.Black;
this.tsbQRCodeSwitch.Image = global::v2rayN.Properties.Resources.share;
resources.ApplyResources(this.tsbQRCodeSwitch, "tsbQRCodeSwitch");
this.tsbQRCodeSwitch.Name = "tsbQRCodeSwitch";
this.tsbQRCodeSwitch.CheckedChanged += new System.EventHandler(this.tsbQRCodeSwitch_CheckedChanged);
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
resources.ApplyResources(this.toolStripSeparator8, "toolStripSeparator8");
this.toolStripSeparator8.Name = "toolStripSeparator8";
//
// tsbSetting
//
resources.ApplyResources(this.tsbSetting, "tsbSetting");
this.tsbSetting.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbOptionSetting,
this.tsbRoutingSetting});
this.tsbSetting.Image = global::v2rayN.Properties.Resources.option;
this.tsbSetting.Name = "tsbSetting";
//
// tsbOptionSetting
//
this.tsbOptionSetting.Image = global::v2rayN.Properties.Resources.option;
resources.ApplyResources(this.tsbOptionSetting, "tsbOptionSetting");
this.tsbOptionSetting.Name = "tsbOptionSetting";
this.tsbOptionSetting.Click += new System.EventHandler(this.tsbOptionSetting_Click);
//
// tsbRoutingSetting
//
resources.ApplyResources(this.tsbRoutingSetting, "tsbRoutingSetting");
this.tsbRoutingSetting.Name = "tsbRoutingSetting";
this.tsbRoutingSetting.Click += new System.EventHandler(this.tsbRoutingSetting_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
this.toolStripSeparator5.Name = "toolStripSeparator5";
//
// tsbReload
//
@ -697,57 +740,45 @@
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
resources.ApplyResources(this.toolStripSeparator7, "toolStripSeparator7");
this.toolStripSeparator7.Name = "toolStripSeparator7";
//
// tsbCheckUpdate
//
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
this.tsbCheckUpdate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbCheckUpdateN,
this.tsbCheckUpdateCore,
this.tsbCheckUpdatePACList,
this.toolStripSeparator13,
this.tsbCheckClearPACList});
this.tsbCheckUpdateXrayCore});
this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate;
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
this.tsbCheckUpdate.Name = "tsbCheckUpdate";
//
// tsbCheckUpdateN
//
this.tsbCheckUpdateN.Name = "tsbCheckUpdateN";
resources.ApplyResources(this.tsbCheckUpdateN, "tsbCheckUpdateN");
this.tsbCheckUpdateN.Name = "tsbCheckUpdateN";
this.tsbCheckUpdateN.Click += new System.EventHandler(this.tsbCheckUpdateN_Click);
//
// tsbCheckUpdateCore
//
this.tsbCheckUpdateCore.Name = "tsbCheckUpdateCore";
resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore");
this.tsbCheckUpdateCore.Name = "tsbCheckUpdateCore";
this.tsbCheckUpdateCore.Click += new System.EventHandler(this.tsbCheckUpdateCore_Click);
//
// tsbCheckUpdatePACList
// tsbCheckUpdateXrayCore
//
this.tsbCheckUpdatePACList.Name = "tsbCheckUpdatePACList";
resources.ApplyResources(this.tsbCheckUpdatePACList, "tsbCheckUpdatePACList");
this.tsbCheckUpdatePACList.Click += new System.EventHandler(this.tsbCheckUpdatePACList_Click);
//
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13");
//
// tsbCheckClearPACList
//
this.tsbCheckClearPACList.Name = "tsbCheckClearPACList";
resources.ApplyResources(this.tsbCheckClearPACList, "tsbCheckClearPACList");
this.tsbCheckClearPACList.Click += new System.EventHandler(this.tsbCheckClearPACList_Click);
resources.ApplyResources(this.tsbCheckUpdateXrayCore, "tsbCheckUpdateXrayCore");
this.tsbCheckUpdateXrayCore.Name = "tsbCheckUpdateXrayCore";
this.tsbCheckUpdateXrayCore.Click += new System.EventHandler(this.tsbCheckUpdateXrayCore_Click);
//
// toolStripSeparator10
//
this.toolStripSeparator10.Name = "toolStripSeparator10";
resources.ApplyResources(this.toolStripSeparator10, "toolStripSeparator10");
this.toolStripSeparator10.Name = "toolStripSeparator10";
//
// tsbHelp
//
resources.ApplyResources(this.tsbHelp, "tsbHelp");
this.tsbHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbAbout,
this.tsbV2rayWebsite,
@ -755,50 +786,49 @@
this.tsbLanguageDef,
this.tsbLanguageZhHans});
this.tsbHelp.Image = global::v2rayN.Properties.Resources.help;
resources.ApplyResources(this.tsbHelp, "tsbHelp");
this.tsbHelp.Name = "tsbHelp";
//
// tsbAbout
//
this.tsbAbout.Name = "tsbAbout";
resources.ApplyResources(this.tsbAbout, "tsbAbout");
this.tsbAbout.Name = "tsbAbout";
this.tsbAbout.Click += new System.EventHandler(this.tsbAbout_Click);
//
// tsbV2rayWebsite
//
this.tsbV2rayWebsite.Name = "tsbV2rayWebsite";
resources.ApplyResources(this.tsbV2rayWebsite, "tsbV2rayWebsite");
this.tsbV2rayWebsite.Name = "tsbV2rayWebsite";
this.tsbV2rayWebsite.Click += new System.EventHandler(this.tsbV2rayWebsite_Click);
//
// toolStripSeparator12
//
this.toolStripSeparator12.Name = "toolStripSeparator12";
resources.ApplyResources(this.toolStripSeparator12, "toolStripSeparator12");
this.toolStripSeparator12.Name = "toolStripSeparator12";
//
// tsbLanguageDef
//
this.tsbLanguageDef.Name = "tsbLanguageDef";
resources.ApplyResources(this.tsbLanguageDef, "tsbLanguageDef");
this.tsbLanguageDef.Name = "tsbLanguageDef";
this.tsbLanguageDef.Click += new System.EventHandler(this.tsbLanguageDef_Click);
//
// tsbLanguageZhHans
//
this.tsbLanguageZhHans.Name = "tsbLanguageZhHans";
resources.ApplyResources(this.tsbLanguageZhHans, "tsbLanguageZhHans");
this.tsbLanguageZhHans.Name = "tsbLanguageZhHans";
this.tsbLanguageZhHans.Click += new System.EventHandler(this.tsbLanguageZhHans_Click);
//
// tsbPromotion
//
resources.ApplyResources(this.tsbPromotion, "tsbPromotion");
this.tsbPromotion.ForeColor = System.Drawing.Color.Black;
this.tsbPromotion.Image = global::v2rayN.Properties.Resources.promotion;
resources.ApplyResources(this.tsbPromotion, "tsbPromotion");
this.tsbPromotion.Name = "tsbPromotion";
this.tsbPromotion.Click += new System.EventHandler(this.tsbPromotion_Click);
//
// toolStripSeparator11
//
this.toolStripSeparator11.Name = "toolStripSeparator11";
resources.ApplyResources(this.toolStripSeparator11, "toolStripSeparator11");
this.toolStripSeparator11.Name = "toolStripSeparator11";
//
// tsbClose
//
@ -831,6 +861,7 @@
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.cmsMsgBox.ResumeLayout(false);
this.ssMain.ResumeLayout(false);
this.ssMain.PerformLayout();
this.tsMain.ResumeLayout(false);
@ -863,7 +894,6 @@
private System.Windows.Forms.ToolStripMenuItem menuExport2ServerConfig;
private System.Windows.Forms.ToolStrip tsMain;
private System.Windows.Forms.ToolStripDropDownButton tsbServer;
private System.Windows.Forms.ToolStripButton tsbOptionSetting;
private System.Windows.Forms.ToolStripButton tsbClose;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
@ -876,9 +906,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.ToolStripMenuItem menuSysAgentMode;
private System.Windows.Forms.ToolStripMenuItem menuGlobal;
private System.Windows.Forms.ToolStripMenuItem menuGlobalPAC;
private System.Windows.Forms.ToolStripMenuItem menuKeep;
private System.Windows.Forms.ToolStripMenuItem menuCopyPACUrl;
private System.Windows.Forms.ToolStripMenuItem menuKeepClear;
private System.Windows.Forms.ToolStripMenuItem menuAddCustomServer;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem menuAddShadowsocksServer;
@ -888,7 +916,6 @@
private System.Windows.Forms.ToolStripDropDownButton tsbCheckUpdate;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateN;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateCore;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdatePACList;
private System.Windows.Forms.ToolStripMenuItem menuAddServers;
private System.Windows.Forms.ToolStripMenuItem menuExport2ShareUrl;
private System.Windows.Forms.ToolStripMenuItem menuSpeedServer;
@ -903,8 +930,6 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripMenuItem tsbSubSetting;
private System.Windows.Forms.ToolStripMenuItem tsbSubUpdate;
private System.Windows.Forms.ToolStripMenuItem tsbCheckClearPACList;
private System.Windows.Forms.ToolStripMenuItem menuKeepPAC;
private System.Windows.Forms.ToolStripMenuItem menuSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuExport2SubContent;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator12;
@ -917,25 +942,34 @@
private System.Windows.Forms.ToolStripStatusLabel toolSslHttpPort;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank2;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank1;
private System.Windows.Forms.ToolStripStatusLabel toolSslPacPort;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank3;
private System.Windows.Forms.ToolStripStatusLabel toolSslSocksPortLab;
private System.Windows.Forms.ToolStripStatusLabel toolSslHttpPortLab;
private System.Windows.Forms.ToolStripStatusLabel toolSslPacPortLab;
private System.Windows.Forms.ToolStripStatusLabel toolSslServerSpeed;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank4;
private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer;
private System.Windows.Forms.ToolStripMenuItem menuTcpingServer;
private System.Windows.Forms.ToolStripMenuItem menuRealPingServer;
private System.Windows.Forms.ToolStripMenuItem menuNotEnabledHttp;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem menuUpdateSubscriptions;
private System.Windows.Forms.ToolStripMenuItem tsbV2rayWebsite;
private System.Windows.Forms.ToolStripMenuItem menuKeepNothing;
private System.Windows.Forms.ToolStripMenuItem menuKeepPACNothing;
private System.Windows.Forms.ToolStripMenuItem tsbTestMe;
private System.Windows.Forms.ToolStripButton tsbReload;
private System.Windows.Forms.ToolStripButton tsbQRCodeSwitch;
private System.Windows.Forms.ToolStripMenuItem menuAddVlessServer;
private System.Windows.Forms.ToolStripMenuItem menuAddTrojanServer;
private System.Windows.Forms.ToolStripDropDownButton tsbSetting;
private System.Windows.Forms.ToolStripMenuItem tsbOptionSetting;
private System.Windows.Forms.ToolStripMenuItem tsbRoutingSetting;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateXrayCore;
private System.Windows.Forms.ToolStripMenuItem menuClearServerStatistics;
private System.Windows.Forms.ToolStripMenuItem menuRoutings;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ContextMenuStrip cmsMsgBox;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopy;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxAddRoutingRule;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopyAll;
}
}

View file

@ -35,8 +35,8 @@ namespace v2rayN.Forms
{
v2rayHandler.V2rayStop();
HttpProxyHandle.CloseHttpAgent(config);
PACServerHandle.Stop();
//HttpProxyHandle.CloseHttpAgent(config);
HttpProxyHandle.UpdateSysProxy(config, true);
ConfigHandler.SaveConfig(ref config);
statistics?.SaveToFile();
@ -47,6 +47,7 @@ namespace v2rayN.Forms
private void MainForm_Load(object sender, EventArgs e)
{
ConfigHandler.LoadConfig(ref config);
ConfigHandler.InitBuiltinRouting(ref config);
v2rayHandler = new V2rayHandler();
v2rayHandler.ProcessEvent += v2rayHandler_ProcessEvent;
@ -73,6 +74,7 @@ namespace v2rayN.Forms
{
InitServersView();
RefreshServers();
RefreshRoutingsMenu();
RestoreUI();
LoadV2ray();
@ -205,6 +207,8 @@ namespace v2rayN.Forms
/// </summary>
private void RefreshServersView()
{
int index = lvServers.SelectedIndices.Count > 0 ? lvServers.SelectedIndices[0] : -1;
lvServers.BeginUpdate();
lvServers.Items.Clear();
@ -222,10 +226,6 @@ 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)
{
@ -239,20 +239,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) // 隔行着色
@ -270,15 +270,11 @@ namespace v2rayN.Forms
}
lvServers.EndUpdate();
//if (lvServers.Items.Count > 0)
//{
// if (lvServers.Items.Count <= testConfigIndex)
// {
// testConfigIndex = lvServers.Items.Count - 1;
// }
// lvServers.Items[testConfigIndex].Selected = true;
// lvServers.Select();
//}
if (index >= 0 && index < lvServers.Items.Count && lvServers.Items.Count > 0)
{
lvServers.Items[index].Selected = true;
lvServers.EnsureVisible(index); // workaround
}
}
/// <summary>
@ -343,29 +339,8 @@ namespace v2rayN.Forms
private void DisplayToolStatus()
{
toolSslSocksPort.Text =
toolSslHttpPort.Text =
toolSslPacPort.Text = "OFF";
toolSslSocksPort.Text = $"{Global.Loopback}:{config.inbound[0].localPort}";
if (config.listenerType != (int)ListenerType.noHttpProxy)
{
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
if (config.listenerType == ListenerType.GlobalPac ||
config.listenerType == ListenerType.PacOpenAndClear ||
config.listenerType == ListenerType.PacOpenOnly)
{
if (PACServerHandle.IsRunning)
{
toolSslPacPort.Text = $"{HttpProxyHandle.GetPacUrl()}";
}
else
{
toolSslPacPort.Text = UIRes.I18N("StartPacFailed");
}
}
}
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
notifyMain.Icon = MainFormHandler.Instance.GetNotifyIcon(config, this.Icon);
}
@ -404,7 +379,7 @@ namespace v2rayN.Forms
{
return;
}
}
#endregion
@ -426,7 +401,7 @@ namespace v2rayN.Forms
ConfigHandler.SaveConfig(ref config, false);
statistics?.SaveToFile();
ChangePACButtonStatus(config.listenerType);
ChangePACButtonStatus(config.sysProxyType);
tsbReload.Enabled = true;
}
@ -475,59 +450,41 @@ namespace v2rayN.Forms
{
return;
}
if (config.vmess[index].configType == (int)EConfigType.Vmess)
ShowServerForm(config.vmess[index].configType, index);
}
private void ShowServerForm(int configType, int index)
{
BaseServerForm fm;
switch (configType)
{
AddServerForm fm = new AddServerForm
{
EditIndex = index
};
if (fm.ShowDialog() == DialogResult.OK)
{
//刷新
RefreshServers();
LoadV2ray();
}
case (int)EConfigType.Vmess:
fm = new AddServerForm();
break;
case (int)EConfigType.Shadowsocks:
fm = new AddServer3Form();
break;
case (int)EConfigType.Socks:
fm = new AddServer4Form();
break;
case (int)EConfigType.VLESS:
fm = new AddServer5Form();
break;
case (int)EConfigType.Trojan:
fm = new AddServer6Form();
break;
default:
fm = new AddServer2Form();
break;
}
else if (config.vmess[index].configType == (int)EConfigType.Shadowsocks)
fm.EditIndex = index;
if (fm.ShowDialog() == DialogResult.OK)
{
AddServer3Form fm = new AddServer3Form
{
EditIndex = index
};
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshServers();
LoadV2ray();
}
}
else if (config.vmess[index].configType == (int)EConfigType.Socks)
{
AddServer4Form fm = new AddServer4Form
{
EditIndex = index
};
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshServers();
LoadV2ray();
}
}
else
{
AddServer2Form fm2 = new AddServer2Form
{
EditIndex = index
};
if (fm2.ShowDialog() == DialogResult.OK)
{
//刷新
RefreshServers();
LoadV2ray();
}
RefreshServers();
LoadV2ray();
}
}
private void lvServers_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
@ -588,16 +545,12 @@ namespace v2rayN.Forms
private void menuAddVmessServer_Click(object sender, EventArgs e)
{
AddServerForm fm = new AddServerForm
{
EditIndex = -1
};
if (fm.ShowDialog() == DialogResult.OK)
{
//刷新
RefreshServers();
LoadV2ray();
}
ShowServerForm((int)EConfigType.Vmess, -1);
}
private void menuAddVlessServer_Click(object sender, EventArgs e)
{
ShowServerForm((int)EConfigType.VLESS, -1);
}
private void menuRemoveServer_Click(object sender, EventArgs e)
@ -616,7 +569,6 @@ namespace v2rayN.Forms
{
ConfigHandler.RemoveServer(ref config, lvSelecteds[k]);
}
//刷新
RefreshServers();
LoadV2ray();
@ -631,7 +583,6 @@ namespace v2rayN.Forms
{
config.vmess = servers;
}
//刷新
RefreshServers();
LoadV2ray();
UI.Show(string.Format(UIRes.I18N("RemoveDuplicateServerResult"), oldCount, newCount));
@ -646,7 +597,6 @@ namespace v2rayN.Forms
}
if (ConfigHandler.CopyServer(ref config, index) == 0)
{
//刷新
RefreshServers();
}
}
@ -708,6 +658,15 @@ namespace v2rayN.Forms
string result = httpProxyTest() + "ms";
AppendText(false, string.Format(UIRes.I18N("TestMeOutput"), result));
}
private void menuClearStatistic_Click(object sender, EventArgs e)
{
if (statistics != null)
{
statistics.ClearAllServerStatistics();
}
}
private int httpProxyTest()
{
SpeedtestHandler statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "", UpdateSpeedtestHandler);
@ -733,7 +692,7 @@ namespace v2rayN.Forms
StringBuilder sb = new StringBuilder();
foreach (int v in lvSelecteds)
{
string url = ConfigHandler.GetVmessQRCode(config, v);
string url = ShareHandler.GetShareUrl(config, v);
if (Utils.IsNullOrEmpty(url))
{
continue;
@ -756,7 +715,7 @@ namespace v2rayN.Forms
StringBuilder sb = new StringBuilder();
foreach (int v in lvSelecteds)
{
string url = ConfigHandler.GetVmessQRCode(config, v);
string url = ShareHandler.GetShareUrl(config, v);
if (Utils.IsNullOrEmpty(url))
{
continue;
@ -776,10 +735,19 @@ namespace v2rayN.Forms
OptionSettingForm fm = new OptionSettingForm();
if (fm.ShowDialog() == DialogResult.OK)
{
//刷新
RefreshServers();
LoadV2ray();
HttpProxyHandle.RestartHttpAgent(config, true);
}
}
private void tsbRoutingSetting_Click(object sender, EventArgs e)
{
var fm = new RoutingSettingForm();
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshRoutingsMenu();
RefreshServers();
LoadV2ray();
}
}
@ -809,7 +777,6 @@ namespace v2rayN.Forms
}
if (ConfigHandler.SetDefaultServer(ref config, index) == 0)
{
//刷新
RefreshServers();
LoadV2ray();
}
@ -866,9 +833,8 @@ namespace v2rayN.Forms
if (ConfigHandler.AddCustomServer(ref config, fileName) == 0)
{
//刷新
RefreshServers();
LoadV2ray();
//LoadV2ray();
UI.Show(UIRes.I18N("SuccessfullyImportedCustomServer"));
}
else
@ -879,41 +845,30 @@ namespace v2rayN.Forms
private void menuAddShadowsocksServer_Click(object sender, EventArgs e)
{
AddServer3Form fm = new AddServer3Form
{
EditIndex = -1
};
if (fm.ShowDialog() == DialogResult.OK)
{
//刷新
RefreshServers();
LoadV2ray();
}
ShowServerForm((int)EConfigType.Shadowsocks, -1);
ShowForm();
}
private void menuAddSocksServer_Click(object sender, EventArgs e)
{
AddServer4Form fm = new AddServer4Form
{
EditIndex = -1
};
if (fm.ShowDialog() == DialogResult.OK)
{
//刷新
RefreshServers();
LoadV2ray();
}
ShowServerForm((int)EConfigType.Socks, -1);
ShowForm();
}
private void menuAddTrojanServer_Click(object sender, EventArgs e)
{
ShowServerForm((int)EConfigType.Trojan, -1);
ShowForm();
}
private void menuAddServers_Click(object sender, EventArgs e)
{
string clipboardData = Utils.GetClipboardData();
int result = AddBatchServers(clipboardData);
if (result > 0)
int ret = MainFormHandler.Instance.AddBatchServers(config, clipboardData);
if (ret > 0)
{
UI.Show(string.Format(UIRes.I18N("SuccessfullyImportedServerViaClipboard"), result));
RefreshServers();
UI.Show(string.Format(UIRes.I18N("SuccessfullyImportedServerViaClipboard"), ret));
}
}
@ -923,23 +878,6 @@ namespace v2rayN.Forms
bgwScan.RunWorkerAsync();
}
private int AddBatchServers(string clipboardData, string subid = "")
{
int counter;
int _Add()
{
return ConfigHandler.AddBatchServers(ref config, clipboardData, subid);
}
counter = _Add();
if (counter < 1)
{
clipboardData = Utils.Base64Decode(clipboardData);
counter = _Add();
}
RefreshServers();
return counter;
}
private void menuUpdateSubscriptions_Click(object sender, EventArgs e)
{
UpdateSubscriptionProcess();
@ -1053,10 +991,11 @@ namespace v2rayN.Forms
this.ShowInTaskbar = true;
//this.notifyIcon1.Visible = false;
this.txtMsgBox.ScrollToCaret();
if (config.index >= 0 && config.index < lvServers.Items.Count)
{
lvServers.EnsureVisible(config.index); // workaround
}
//if (config.index >= 0 && config.index < lvServers.Items.Count)
//{
// lvServers.Items[config.index].Selected = true;
// lvServers.EnsureVisible(config.index); // workaround
//}
SetVisibleCore(true);
}
@ -1169,7 +1108,7 @@ namespace v2rayN.Forms
{
//TODO: reload is not good.
RefreshServers();
LoadV2ray();
//LoadV2ray();
}
}
private void menuSelectAll_Click(object sender, EventArgs e)
@ -1183,56 +1122,36 @@ namespace v2rayN.Forms
#endregion
#region
private void menuCopyPACUrl_Click(object sender, EventArgs e)
private void menuKeepClear_Click(object sender, EventArgs e)
{
Utils.SetClipboardData(HttpProxyHandle.GetPacUrl());
}
private void menuNotEnabledHttp_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.noHttpProxy);
SetListenerType(ESysProxyType.ForcedClear);
}
private void menuGlobal_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.GlobalHttp);
}
private void menuGlobalPAC_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.GlobalPac);
}
private void menuKeep_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.HttpOpenAndClear);
}
private void menuKeepPAC_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.PacOpenAndClear);
SetListenerType(ESysProxyType.ForcedChange);
}
private void menuKeepNothing_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.HttpOpenOnly);
SetListenerType(ESysProxyType.Unchanged);
}
private void menuKeepPACNothing_Click(object sender, EventArgs e)
private void SetListenerType(ESysProxyType type)
{
SetListenerType(ListenerType.PacOpenOnly);
}
private void SetListenerType(ListenerType type)
{
config.listenerType = type;
config.sysProxyType = type;
ChangePACButtonStatus(type);
}
private void ChangePACButtonStatus(ListenerType type)
private void ChangePACButtonStatus(ESysProxyType type)
{
if (type != ListenerType.noHttpProxy)
{
HttpProxyHandle.RestartHttpAgent(config, false);
}
else
{
HttpProxyHandle.CloseHttpAgent(config);
}
HttpProxyHandle.UpdateSysProxy(config, false);
//if (type != ListenerType.noHttpProxy)
//{
// HttpProxyHandle.RestartHttpAgent(config, false);
//}
//else
//{
// HttpProxyHandle.CloseHttpAgent(config);
//}
for (int k = 0; k < menuSysAgentMode.DropDownItems.Count; k++)
{
@ -1298,7 +1217,16 @@ namespace v2rayN.Forms
try
{
string fileName = Utils.GetPath(downloadHandle.DownloadFileName);
Process process = Process.Start("v2rayUpgrade.exe", "\"" + fileName + "\"");
Process process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "v2rayUpgrade.exe",
Arguments = "\"" + fileName + "\"",
WorkingDirectory = Utils.StartupPath()
}
};
process.Start();
if (process.Id > 0)
{
menuExit_Click(null, null);
@ -1325,6 +1253,16 @@ namespace v2rayN.Forms
}
private void tsbCheckUpdateCore_Click(object sender, EventArgs e)
{
CheckUpdateCore("v2fly");
}
private void tsbCheckUpdateXrayCore_Click(object sender, EventArgs e)
{
CheckUpdateCore("xray");
}
private void CheckUpdateCore(string type)
{
DownloadHandle downloadHandle = null;
if (downloadHandle == null)
@ -1360,7 +1298,7 @@ namespace v2rayN.Forms
string fileName = downloadHandle.DownloadFileName;
fileName = Utils.GetPath(fileName);
FileManager.ZipExtractToFile(fileName);
FileManager.ZipExtractToFile(fileName, config.ignoreGeoUpdateCore ? "geo" : "");
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfullyMore"));
@ -1386,53 +1324,7 @@ namespace v2rayN.Forms
}
AppendText(false, string.Format(UIRes.I18N("MsgStartUpdating"), "v2rayCore"));
downloadHandle.CheckUpdateAsync("Core");
}
private void tsbCheckUpdatePACList_Click(object sender, EventArgs e)
{
DownloadHandle pacListHandle = null;
if (pacListHandle == null)
{
pacListHandle = new DownloadHandle();
pacListHandle.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
string result = args.Msg;
if (Utils.IsNullOrEmpty(result))
{
return;
}
pacListHandle.GenPacFile(result);
AppendText(false, UIRes.I18N("MsgPACUpdateSuccessfully"));
}
else
{
AppendText(false, UIRes.I18N("MsgPACUpdateFailed"));
}
};
pacListHandle.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
}
AppendText(false, UIRes.I18N("MsgStartUpdatingPAC"));
pacListHandle.WebDownloadString(config.urlGFWList);
}
private void tsbCheckClearPACList_Click(object sender, EventArgs e)
{
try
{
File.WriteAllText(Utils.GetPath(Global.pacFILE), Utils.GetEmbedText(Global.BlankPacFileName), Encoding.UTF8);
AppendText(false, UIRes.I18N("MsgSimplifyPAC"));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
downloadHandle.CheckUpdateAsync(type);
}
#endregion
@ -1475,8 +1367,10 @@ namespace v2rayN.Forms
}
else
{
if (AddBatchServers(result) > 0)
int ret = MainFormHandler.Instance.AddBatchServers(config, result);
if (ret > 0)
{
RefreshServers();
UI.Show(UIRes.I18N("SuccessfullyImportedServerViaScan"));
}
}
@ -1504,67 +1398,15 @@ namespace v2rayN.Forms
/// </summary>
private void UpdateSubscriptionProcess()
{
AppendText(false, UIRes.I18N("MsgUpdateSubscriptionStart"));
if (config.subItem == null || config.subItem.Count <= 0)
void _updateUI(bool refresh, string msg)
{
AppendText(false, UIRes.I18N("MsgNoValidSubscription"));
return;
}
for (int k = 1; k <= config.subItem.Count; k++)
{
string id = config.subItem[k - 1].id.TrimEx();
string url = config.subItem[k - 1].url.TrimEx();
string hashCode = $"{k}->";
if (config.subItem[k - 1].enabled == false)
AppendText(false, msg);
if (refresh)
{
continue;
RefreshServers();
}
if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url))
{
AppendText(false, $"{hashCode}{UIRes.I18N("MsgNoValidSubscription")}");
continue;
}
DownloadHandle downloadHandle3 = new DownloadHandle();
downloadHandle3.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
AppendText(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}");
string result = Utils.Base64Decode(args.Msg);
if (Utils.IsNullOrEmpty(result))
{
AppendText(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}");
return;
}
ConfigHandler.RemoveServerViaSubid(ref config, id);
AppendText(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}");
RefreshServers();
if (AddBatchServers(result, id) > 0)
{
}
else
{
AppendText(false, $"{hashCode}{UIRes.I18N("MsgFailedImportSubscription")}");
}
AppendText(false, $"{hashCode}{UIRes.I18N("MsgUpdateSubscriptionEnd")}");
}
else
{
AppendText(false, args.Msg);
}
};
downloadHandle3.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
downloadHandle3.WebDownloadString(url);
AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
}
};
MainFormHandler.Instance.UpdateSubscriptionProcess(config, _updateUI);
}
private void tsbQRCodeSwitch_CheckedChanged(object sender, EventArgs e)
@ -1593,6 +1435,114 @@ namespace v2rayN.Forms
#endregion
#region RoutingsMenu
/// <summary>
///
/// </summary>
private void RefreshRoutingsMenu()
{
menuRoutings.Visible = config.enableRoutingAdvanced;
if (!config.enableRoutingAdvanced)
{
return;
}
menuRoutings.DropDownItems.Clear();
List<ToolStripMenuItem> lst = new List<ToolStripMenuItem>();
for (int k = 0; k < config.routings.Count; k++)
{
var item = config.routings[k];
if (item.locked == true)
{
continue;
}
string name = item.remarks;
ToolStripMenuItem ts = new ToolStripMenuItem(name)
{
Tag = k
};
if (config.routingIndex.Equals(k))
{
ts.Checked = true;
}
ts.Click += new EventHandler(ts_Routing_Click);
lst.Add(ts);
}
menuRoutings.DropDownItems.AddRange(lst.ToArray());
}
private void ts_Routing_Click(object sender, EventArgs e)
{
try
{
ToolStripItem ts = (ToolStripItem)sender;
int index = Utils.ToInt(ts.Tag);
if (ConfigHandler.SetDefaultRouting(ref config, index) == 0)
{
RefreshRoutingsMenu();
LoadV2ray();
}
}
catch
{
}
}
#endregion
#region MsgBoxMenu
private void menuMsgBoxSelectAll_Click(object sender, EventArgs e)
{
this.txtMsgBox.Focus();
this.txtMsgBox.SelectAll();
}
private void menuMsgBoxCopy_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.SelectedText.TrimEx();
Utils.SetClipboardData(data);
}
private void menuMsgBoxCopyAll_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.Text;
Utils.SetClipboardData(data);
}
private void menuMsgBoxAddRoutingRule_Click(object sender, EventArgs e)
{
menuMsgBoxCopy_Click(null, null);
tsbRoutingSetting_Click(null, null);
}
private void txtMsgBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
switch (e.KeyCode)
{
case Keys.A:
menuMsgBoxSelectAll_Click(null, null);
break;
case Keys.C:
menuMsgBoxCopy_Click(null, null);
break;
case Keys.V:
menuMsgBoxAddRoutingRule_Click(null, null);
break;
}
}
}
#endregion
}

File diff suppressed because it is too large Load diff

View file

@ -124,6 +124,12 @@
<data name="menuAddVmessServer.Text" xml:space="preserve">
<value>添加[VMess]服务器</value>
</data>
<data name="menuAddVlessServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuAddVlessServer.Text" xml:space="preserve">
<value>添加[VLESS]服务器</value>
</data>
<data name="menuAddShadowsocksServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
@ -136,6 +142,12 @@
<data name="menuAddSocksServer.Text" xml:space="preserve">
<value>添加[Socks]服务器</value>
</data>
<data name="menuAddTrojanServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuAddTrojanServer.Text" xml:space="preserve">
<value>添加[Trojan]服务器</value>
</data>
<data name="menuAddCustomServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
@ -241,6 +253,18 @@
<data name="menuSpeedServer.Text" xml:space="preserve">
<value>测试服务器速度(多选) (Ctrl+T)</value>
</data>
<data name="tsbTestMe.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="tsbTestMe.Text" xml:space="preserve">
<value>测试当前服务状态</value>
</data>
<data name="menuClearServerStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuClearServerStatistics.Text" xml:space="preserve">
<value>清除所有服务统计数据</value>
</data>
<data name="toolStripSeparator6.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
</data>
@ -275,7 +299,7 @@
<value> 服务器 </value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>301, 534</value>
<value>301, 622</value>
</data>
<data name="lvServers.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
@ -294,53 +318,35 @@
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
<data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 22</value>
</data>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>关闭Http代理</value>
<data name="menuKeepClear.Text" xml:space="preserve">
<value>清除系统代理</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
<value>172, 22</value>
</data>
<data name="menuGlobal.Text" xml:space="preserve">
<value>开启Http代理,并自动配置系统代理(全局模式)</value>
</data>
<data name="menuGlobalPAC.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuGlobalPAC.Text" xml:space="preserve">
<value>开启PAC,并自动配置系统代理(PAC模式)</value>
</data>
<data name="menuKeep.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeep.Text" xml:space="preserve">
<value>仅开启Http代理,并清除系统代理</value>
</data>
<data name="menuKeepPAC.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeepPAC.Text" xml:space="preserve">
<value>仅开启PAC,并清除系统代理</value>
<value>自动配置系统代理</value>
</data>
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
<value>172, 22</value>
</data>
<data name="menuKeepNothing.Text" xml:space="preserve">
<value>仅开启Http代理,不改变系统代理</value>
</data>
<data name="menuKeepPACNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeepPACNothing.Text" xml:space="preserve">
<value>仅开启PAC,不改变系统代理</value>
<value>不改变系统代理</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http代理</value>
<value>系统代理</value>
</data>
<data name="menuRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuRoutings.Text" xml:space="preserve">
<value>路由</value>
</data>
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
@ -348,6 +354,9 @@
<data name="menuServers.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="toolStripSeparator13.Size" type="System.Drawing.Size, System.Drawing">
<value>192, 6</value>
</data>
<data name="menuAddServers2.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
@ -360,12 +369,6 @@
<data name="menuScanScreen2.Text" xml:space="preserve">
<value>扫描屏幕上的二维码</value>
</data>
<data name="menuCopyPACUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuCopyPACUrl.Text" xml:space="preserve">
<value>复制本地PAC网址</value>
</data>
<data name="menuUpdateSubscriptions.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
@ -382,11 +385,38 @@
<value>退出</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 164</value>
<value>196, 170</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器列表</value>
</data>
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxCopy.Text" xml:space="preserve">
<value>复制 (Ctrl+C)</value>
</data>
<data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxCopyAll.Text" xml:space="preserve">
<value>复制所有</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
<value>快速添加路由规则 (Ctrl+V)</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 114</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
@ -411,67 +441,64 @@
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
</data>
<data name="tsbQRCodeSwitch.Size" type="System.Drawing.Size, System.Drawing">
<value>52, 53</value>
</data>
<data name="tsbQRCodeSwitch.Text" xml:space="preserve">
<value> 分享 </value>
</data>
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 53</value>
<value>124, 22</value>
</data>
<data name="tsbOptionSetting.Text" xml:space="preserve">
<value> 参数设置 </value>
<value>参数设置</value>
</data>
<data name="tsbRoutingSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 22</value>
</data>
<data name="tsbRoutingSetting.Text" xml:space="preserve">
<value>路由设置</value>
</data>
<data name="tsbSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSetting.Text" xml:space="preserve">
<value> 设置 </value>
</data>
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
NQwF4JkcFRWiUAB7IVW2FFPO3YqlgPd+LJf02e8Fdi3rMdIAcLDuf9UpeT0IS0G/hvhPm305vSl7EQFY
B6zCvozvYGzRM8zEoeg5TPZwDaGvpHQni1yzSxbXPW9q+hF13ROHuJnQcjbhtQAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsbReload.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
<value>76, 53</value>
</data>
<data name="tsbReload.Text" xml:space="preserve">
<value> 重启服务 </value>
</data>
<data name="tsbTestMe.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="tsbTestMe.Text" xml:space="preserve">
<value>测试当前服务状态</value>
</data>
<data name="tsbService.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAATdJREFUWEftloENAiEMRW8ER3AEN9ANdARHcAPdwBF0A91AN9INtC+5JvUCJwWM
mvCTFw3QUiiU65qa/lUTYT6Ato9rJZyERwT6GFNdU+EihCYNwVhsqmgm3AR1fheOAitd9PCfNvp0HDbY
FolV2MmZZCzX9J0FG0TRTlwFdbahIVE7Qe1IR5bYVnXCyr2yO5F1MNUBec25YtjomcCXSxhr9DmrV2Gr
flyL4GSrYcm9tmnEZ7JsAC7DgWr5ydbXA8hOAcVjG8FTD6ocQgvXKrW8MqFWUfc1DAXgmRwVFaJQAHsh
VbYUU87diqWA934sl/TZ7wV2Lesx0gBwsO5/1Sl5PQhLQb+G+E+bfTm9KXsRAVgHrMK+jO9gbNEzzMSh
6DlM9nANoa+kdCeLXLNLFtc9b2r6EXXdE4e4mdByNuG1AAAAAElFTkSuQmCC
</value>
</data>
<data name="tsbService.Size" type="System.Drawing.Size, System.Drawing">
<value>85, 53</value>
</data>
<data name="tsbService.Text" xml:space="preserve">
<value> 当前服务 </value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 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>223, 22</value>
<value>135, 22</value>
</data>
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
<value>v2rayCore</value>
<value>v2fly-Core</value>
</data>
<data name="tsbCheckUpdatePACList.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 22</value>
<data name="tsbCheckUpdateXrayCore.Size" type="System.Drawing.Size, System.Drawing">
<value>135, 22</value>
</data>
<data name="tsbCheckUpdatePACList.Text" xml:space="preserve">
<value>PAC</value>
</data>
<data name="toolStripSeparator13.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 6</value>
</data>
<data name="tsbCheckClearPACList.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 22</value>
</data>
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
<value>简化PAC (请设置Core路由)</value>
<data name="tsbCheckUpdateXrayCore.Text" xml:space="preserve">
<value>Xray-Core</value>
</data>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>85, 53</value>
@ -499,9 +526,9 @@
</data>
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAADJJREFUWEftzrENACAIRUFGdVMdTZkAG4zFXfI68kMAAD8ap9lUbpfyaDV19QAA
8FDEBl3RImu5VcdbAAAAAElFTkSuQmCC
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsbClose.Size" type="System.Drawing.Size, System.Drawing">
@ -510,7 +537,4 @@
<data name="tsbClose.Text" xml:space="preserve">
<value> 关闭窗口 </value>
</data>
<data name="tsbQRCodeSwitch.Text" xml:space="preserve">
<value> 分享 </value>
</data>
</root>

View file

@ -34,12 +34,8 @@
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.chkdefAllowInsecure = new System.Windows.Forms.CheckBox();
this.label16 = new System.Windows.Forms.Label();
this.cmblistenerType = new System.Windows.Forms.ComboBox();
this.chksniffingEnabled2 = new System.Windows.Forms.CheckBox();
this.chksniffingEnabled = new System.Windows.Forms.CheckBox();
this.txtremoteDNS = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.chkmuxEnabled = new System.Windows.Forms.CheckBox();
this.chkAllowIn2 = new System.Windows.Forms.CheckBox();
this.chkudpEnabled2 = new System.Windows.Forms.CheckBox();
@ -55,21 +51,9 @@
this.txtlocalPort = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.txtUseragent = new System.Windows.Forms.TextBox();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.txtUserdirect = new System.Windows.Forms.TextBox();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.txtUserblock = new System.Windows.Forms.TextBox();
this.tabPage8 = new System.Windows.Forms.TabPage();
this.cmbroutingMode = new System.Windows.Forms.ComboBox();
this.panel3 = new System.Windows.Forms.Panel();
this.linkLabelRoutingDoc = new System.Windows.Forms.LinkLabel();
this.btnSetDefRountingRule = new System.Windows.Forms.Button();
this.labRoutingTips = new System.Windows.Forms.Label();
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
this.linkDnsObjectDoc = new System.Windows.Forms.LinkLabel();
this.txtremoteDNS = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.tabPage6 = new System.Windows.Forms.TabPage();
this.chkKcpcongestion = new System.Windows.Forms.CheckBox();
this.txtKcpwriteBufferSize = new System.Windows.Forms.TextBox();
@ -85,18 +69,15 @@
this.txtKcpmtu = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.chkIgnoreGeoUpdateCore = new System.Windows.Forms.CheckBox();
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();
this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
this.chkAllowLANConn = new System.Windows.Forms.CheckBox();
this.txturlGFWList = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.chkAutoRun = new System.Windows.Forms.CheckBox();
this.tabPage9 = new System.Windows.Forms.TabPage();
this.txtuserPacRule = new System.Windows.Forms.TextBox();
this.panel4 = new System.Windows.Forms.Panel();
this.label4 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
@ -104,56 +85,41 @@
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tabControl2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
this.tabPage8.SuspendLayout();
this.panel3.SuspendLayout();
this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout();
this.tabPage9.SuspendLayout();
this.panel4.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// btnClose
//
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// tabControl1
//
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPage9);
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
//
// tabPage1
//
resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Controls.Add(this.groupBox1);
resources.ApplyResources(this.tabPage1, "tabPage1");
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.label16);
this.groupBox1.Controls.Add(this.cmblistenerType);
this.groupBox1.Controls.Add(this.chksniffingEnabled2);
this.groupBox1.Controls.Add(this.chksniffingEnabled);
this.groupBox1.Controls.Add(this.txtremoteDNS);
this.groupBox1.Controls.Add(this.label14);
this.groupBox1.Controls.Add(this.chkmuxEnabled);
this.groupBox1.Controls.Add(this.chkAllowIn2);
this.groupBox1.Controls.Add(this.chkudpEnabled2);
@ -168,6 +134,7 @@
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;
//
@ -177,26 +144,6 @@
this.chkdefAllowInsecure.Name = "chkdefAllowInsecure";
this.chkdefAllowInsecure.UseVisualStyleBackColor = true;
//
// label16
//
resources.ApplyResources(this.label16, "label16");
this.label16.Name = "label16";
//
// cmblistenerType
//
resources.ApplyResources(this.cmblistenerType, "cmblistenerType");
this.cmblistenerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmblistenerType.FormattingEnabled = true;
this.cmblistenerType.Items.AddRange(new object[] {
resources.GetString("cmblistenerType.Items"),
resources.GetString("cmblistenerType.Items1"),
resources.GetString("cmblistenerType.Items2"),
resources.GetString("cmblistenerType.Items3"),
resources.GetString("cmblistenerType.Items4"),
resources.GetString("cmblistenerType.Items5"),
resources.GetString("cmblistenerType.Items6")});
this.cmblistenerType.Name = "cmblistenerType";
//
// chksniffingEnabled2
//
resources.ApplyResources(this.chksniffingEnabled2, "chksniffingEnabled2");
@ -209,16 +156,6 @@
this.chksniffingEnabled.Name = "chksniffingEnabled";
this.chksniffingEnabled.UseVisualStyleBackColor = true;
//
// txtremoteDNS
//
resources.ApplyResources(this.txtremoteDNS, "txtremoteDNS");
this.txtremoteDNS.Name = "txtremoteDNS";
//
// label14
//
resources.ApplyResources(this.label14, "label14");
this.label14.Name = "label14";
//
// chkmuxEnabled
//
resources.ApplyResources(this.chkmuxEnabled, "chkmuxEnabled");
@ -240,12 +177,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
@ -260,8 +197,8 @@
//
// cmbprotocol
//
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.FormattingEnabled = true;
this.cmbprotocol.Items.AddRange(new object[] {
resources.GetString("cmbprotocol.Items"),
@ -287,7 +224,6 @@
//
// cmbloglevel
//
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbloglevel.FormattingEnabled = true;
this.cmbloglevel.Items.AddRange(new object[] {
@ -296,6 +232,7 @@
resources.GetString("cmbloglevel.Items2"),
resources.GetString("cmbloglevel.Items3"),
resources.GetString("cmbloglevel.Items4")});
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.Name = "cmbloglevel";
//
// label5
@ -315,127 +252,32 @@
//
// 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.Controls.Add(this.groupBox2);
this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// groupBox2
// linkDnsObjectDoc
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.tabControl2);
this.groupBox2.Controls.Add(this.panel3);
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
resources.ApplyResources(this.linkDnsObjectDoc, "linkDnsObjectDoc");
this.linkDnsObjectDoc.Name = "linkDnsObjectDoc";
this.linkDnsObjectDoc.TabStop = true;
this.linkDnsObjectDoc.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkDnsObjectDoc_LinkClicked);
//
// tabControl2
// txtremoteDNS
//
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Controls.Add(this.tabPage3);
this.tabControl2.Controls.Add(this.tabPage4);
this.tabControl2.Controls.Add(this.tabPage5);
this.tabControl2.Controls.Add(this.tabPage8);
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
resources.ApplyResources(this.txtremoteDNS, "txtremoteDNS");
this.txtremoteDNS.Name = "txtremoteDNS";
//
// tabPage3
// label14
//
resources.ApplyResources(this.tabPage3, "tabPage3");
this.tabPage3.Controls.Add(this.txtUseragent);
this.tabPage3.Name = "tabPage3";
this.tabPage3.UseVisualStyleBackColor = true;
//
// txtUseragent
//
resources.ApplyResources(this.txtUseragent, "txtUseragent");
this.txtUseragent.Name = "txtUseragent";
//
// tabPage4
//
resources.ApplyResources(this.tabPage4, "tabPage4");
this.tabPage4.Controls.Add(this.txtUserdirect);
this.tabPage4.Name = "tabPage4";
this.tabPage4.UseVisualStyleBackColor = true;
//
// txtUserdirect
//
resources.ApplyResources(this.txtUserdirect, "txtUserdirect");
this.txtUserdirect.Name = "txtUserdirect";
//
// tabPage5
//
resources.ApplyResources(this.tabPage5, "tabPage5");
this.tabPage5.Controls.Add(this.txtUserblock);
this.tabPage5.Name = "tabPage5";
this.tabPage5.UseVisualStyleBackColor = true;
//
// txtUserblock
//
resources.ApplyResources(this.txtUserblock, "txtUserblock");
this.txtUserblock.Name = "txtUserblock";
//
// tabPage8
//
resources.ApplyResources(this.tabPage8, "tabPage8");
this.tabPage8.Controls.Add(this.cmbroutingMode);
this.tabPage8.Name = "tabPage8";
this.tabPage8.UseVisualStyleBackColor = true;
//
// cmbroutingMode
//
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbroutingMode.FormattingEnabled = true;
this.cmbroutingMode.Items.AddRange(new object[] {
resources.GetString("cmbroutingMode.Items"),
resources.GetString("cmbroutingMode.Items1"),
resources.GetString("cmbroutingMode.Items2"),
resources.GetString("cmbroutingMode.Items3")});
this.cmbroutingMode.Name = "cmbroutingMode";
//
// panel3
//
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.linkLabelRoutingDoc);
this.panel3.Controls.Add(this.btnSetDefRountingRule);
this.panel3.Controls.Add(this.labRoutingTips);
this.panel3.Controls.Add(this.cmbdomainStrategy);
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
//
resources.ApplyResources(this.btnSetDefRountingRule, "btnSetDefRountingRule");
this.btnSetDefRountingRule.Name = "btnSetDefRountingRule";
this.btnSetDefRountingRule.UseVisualStyleBackColor = true;
this.btnSetDefRountingRule.Click += new System.EventHandler(this.btnSetDefRountingRule_Click);
//
// labRoutingTips
//
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
this.labRoutingTips.Name = "labRoutingTips";
//
// cmbdomainStrategy
//
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainStrategy.FormattingEnabled = true;
this.cmbdomainStrategy.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy.Items"),
resources.GetString("cmbdomainStrategy.Items1"),
resources.GetString("cmbdomainStrategy.Items2")});
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
resources.ApplyResources(this.label14, "label14");
this.label14.Name = "label14";
//
// tabPage6
//
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Controls.Add(this.chkKcpcongestion);
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
this.tabPage6.Controls.Add(this.label10);
@ -449,6 +291,7 @@
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;
//
@ -520,18 +363,40 @@
//
// tabPage7
//
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Controls.Add(this.chkIgnoreGeoUpdateCore);
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.txturlGFWList);
this.tabPage7.Controls.Add(this.label13);
this.tabPage7.Controls.Add(this.chkAutoRun);
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true;
//
// chkIgnoreGeoUpdateCore
//
resources.ApplyResources(this.chkIgnoreGeoUpdateCore, "chkIgnoreGeoUpdateCore");
this.chkIgnoreGeoUpdateCore.Name = "chkIgnoreGeoUpdateCore";
this.chkIgnoreGeoUpdateCore.UseVisualStyleBackColor = true;
//
// 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")});
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
this.cmbCoreType.Name = "cmbCoreType";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// chkKeepOlderDedupl
//
resources.ApplyResources(this.chkKeepOlderDedupl, "chkKeepOlderDedupl");
@ -540,9 +405,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
@ -562,52 +427,17 @@
this.chkAllowLANConn.Name = "chkAllowLANConn";
this.chkAllowLANConn.UseVisualStyleBackColor = true;
//
// txturlGFWList
//
resources.ApplyResources(this.txturlGFWList, "txturlGFWList");
this.txturlGFWList.Name = "txturlGFWList";
//
// label13
//
resources.ApplyResources(this.label13, "label13");
this.label13.Name = "label13";
//
// chkAutoRun
//
resources.ApplyResources(this.chkAutoRun, "chkAutoRun");
this.chkAutoRun.Name = "chkAutoRun";
this.chkAutoRun.UseVisualStyleBackColor = true;
//
// tabPage9
//
resources.ApplyResources(this.tabPage9, "tabPage9");
this.tabPage9.Controls.Add(this.txtuserPacRule);
this.tabPage9.Controls.Add(this.panel4);
this.tabPage9.Name = "tabPage9";
this.tabPage9.UseVisualStyleBackColor = true;
//
// txtuserPacRule
//
resources.ApplyResources(this.txtuserPacRule, "txtuserPacRule");
this.txtuserPacRule.Name = "txtuserPacRule";
//
// panel4
//
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.label4);
this.panel4.Name = "panel4";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.ForeColor = System.Drawing.Color.Brown;
this.label4.Name = "label4";
//
// 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
@ -638,24 +468,11 @@
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.tabControl2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.tabPage5.ResumeLayout(false);
this.tabPage5.PerformLayout();
this.tabPage8.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.tabPage2.PerformLayout();
this.tabPage6.ResumeLayout(false);
this.tabPage6.PerformLayout();
this.tabPage7.ResumeLayout(false);
this.tabPage7.PerformLayout();
this.tabPage9.ResumeLayout(false);
this.tabPage9.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
@ -675,9 +492,7 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.ComboBox cmbprotocol;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cmbprotocol2;
@ -686,14 +501,6 @@
private System.Windows.Forms.CheckBox chkudpEnabled2;
private System.Windows.Forms.CheckBox chkAllowIn2;
private System.Windows.Forms.CheckBox chkmuxEnabled;
private System.Windows.Forms.TabControl tabControl2;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.Label labRoutingTips;
private System.Windows.Forms.TextBox txtUseragent;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.TextBox txtUserdirect;
private System.Windows.Forms.TextBox txtUserblock;
private System.Windows.Forms.TabPage tabPage6;
private System.Windows.Forms.TextBox txtKcpmtu;
private System.Windows.Forms.Label label6;
@ -710,29 +517,20 @@
private System.Windows.Forms.CheckBox chkKcpcongestion;
private System.Windows.Forms.TabPage tabPage7;
private System.Windows.Forms.CheckBox chkAutoRun;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox txturlGFWList;
private System.Windows.Forms.CheckBox chkAllowLANConn;
private System.Windows.Forms.TextBox txtremoteDNS;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.ComboBox cmbdomainStrategy;
private System.Windows.Forms.ComboBox cmbroutingMode;
private System.Windows.Forms.CheckBox chksniffingEnabled;
private System.Windows.Forms.CheckBox chksniffingEnabled2;
private System.Windows.Forms.Button btnSetDefRountingRule;
private System.Windows.Forms.CheckBox chkEnableStatistics;
private System.Windows.Forms.ComboBox cbFreshrate;
private System.Windows.Forms.Label lbFreshrate;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.ComboBox cmblistenerType;
private System.Windows.Forms.TabPage tabPage8;
private System.Windows.Forms.TabPage tabPage9;
private System.Windows.Forms.TextBox txtuserPacRule;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox chkKeepOlderDedupl;
private System.Windows.Forms.LinkLabel linkLabelRoutingDoc;
private System.Windows.Forms.CheckBox chkdefAllowInsecure;
private System.Windows.Forms.TabPage tabPage2;
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;
private System.Windows.Forms.CheckBox chkIgnoreGeoUpdateCore;
}
}

View file

@ -4,6 +4,7 @@ using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Base;
using v2rayN.HttpProxyHandler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
@ -18,13 +19,9 @@ namespace v2rayN.Forms
{
InitBase();
InitRouting();
InitKCP();
InitGUI();
InitUserPAC();
}
/// <summary>
@ -68,25 +65,10 @@ namespace v2rayN.Forms
//remoteDNS
txtremoteDNS.Text = config.remoteDNS;
cmblistenerType.SelectedIndex = (int)config.listenerType;
chkdefAllowInsecure.Checked = config.defAllowInsecure;
}
/// <summary>
/// 初始化路由设置
/// </summary>
private void InitRouting()
{
//路由
cmbdomainStrategy.Text = config.domainStrategy;
int.TryParse(config.routingMode, out int routingMode);
cmbroutingMode.SelectedIndex = routingMode;
txtUseragent.Text = Utils.List2String(config.useragent, true);
txtUserdirect.Text = Utils.List2String(config.userdirect, true);
txtUserblock.Text = Utils.List2String(config.userblock, true);
}
/// <summary>
/// 初始化KCP设置
@ -110,16 +92,10 @@ namespace v2rayN.Forms
//开机自动启动
chkAutoRun.Checked = Utils.IsAutoRun();
//自定义GFWList
txturlGFWList.Text = config.urlGFWList;
chkAllowLANConn.Checked = config.allowLANConn;
chkEnableStatistics.Checked = config.enableStatistics;
chkKeepOlderDedupl.Checked = config.keepOlderDedupl;
ComboItem[] cbSource = new ComboItem[]
{
new ComboItem{ID = (int)Global.StatisticsFreshRate.quick, Text = UIRes.I18N("QuickFresh")},
@ -144,13 +120,9 @@ namespace v2rayN.Forms
break;
}
chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore;
cmbCoreType.SelectedIndex = (int)config.coreType;
}
private void InitUserPAC()
{
txtuserPacRule.Text = Utils.List2String(config.userPacRule, true);
}
private void btnOK_Click(object sender, EventArgs e)
{
if (SaveBase() != 0)
@ -158,10 +130,6 @@ namespace v2rayN.Forms
return;
}
if (SaveRouting() != 0)
{
return;
}
if (SaveKCP() != 0)
{
@ -173,11 +141,6 @@ namespace v2rayN.Forms
return;
}
if (SaveUserPAC() != 0)
{
return;
}
if (ConfigHandler.SaveConfig(ref config) == 0)
{
this.DialogResult = DialogResult.OK;
@ -265,36 +228,12 @@ namespace v2rayN.Forms
//remoteDNS
config.remoteDNS = txtremoteDNS.Text.TrimEx();
config.listenerType = (ListenerType)Enum.ToObject(typeof(ListenerType), cmblistenerType.SelectedIndex);
config.defAllowInsecure = chkdefAllowInsecure.Checked;
return 0;
}
/// <summary>
/// 保存路由设置
/// </summary>
/// <returns></returns>
private int SaveRouting()
{
//路由
string domainStrategy = cmbdomainStrategy.Text;
string routingMode = cmbroutingMode.SelectedIndex.ToString();
string useragent = txtUseragent.Text.TrimEx();
string userdirect = txtUserdirect.Text.TrimEx();
string userblock = txtUserblock.Text.TrimEx();
config.domainStrategy = domainStrategy;
config.routingMode = routingMode;
config.useragent = Utils.String2List(useragent);
config.userdirect = Utils.String2List(userdirect);
config.userblock = Utils.String2List(userblock);
return 0;
}
/// <summary>
/// 保存KCP设置
@ -340,9 +279,6 @@ namespace v2rayN.Forms
//开机自动启动
Utils.SetAutoRun(chkAutoRun.Checked);
//自定义GFWList
config.urlGFWList = txturlGFWList.Text.TrimEx();
config.allowLANConn = chkAllowLANConn.Checked;
bool lastEnableStatistics = config.enableStatistics;
@ -350,27 +286,12 @@ namespace v2rayN.Forms
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue;
config.keepOlderDedupl = chkKeepOlderDedupl.Checked;
//if(lastEnableStatistics != config.enableStatistics)
//{
// /// https://stackoverflow.com/questions/779405/how-do-i-restart-my-c-sharp-winform-application
// // Shut down the current app instance.
// Application.Exit();
// // Restart the app passing "/restart [processId]" as cmd line args
// Process.Start(Application.ExecutablePath, "/restart " + Process.GetCurrentProcess().Id);
//}
return 0;
}
private int SaveUserPAC()
{
string userPacRule = txtuserPacRule.Text.TrimEx();
userPacRule = userPacRule.Replace("\"", "");
config.userPacRule = Utils.String2List(userPacRule);
config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked;
config.coreType = (ECoreType)cmbCoreType.SelectedIndex;
return 0;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
@ -388,75 +309,9 @@ namespace v2rayN.Forms
chkudpEnabled2.Enabled = blAllow2;
}
private void btnSetDefRountingRule_Click(object sender, EventArgs e)
private void linkDnsObjectDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
txtUseragent.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.agentTag);
txtUserdirect.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.directTag);
txtUserblock.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.blockTag);
cmbroutingMode.SelectedIndex = 3;
List<string> lstUrl = new List<string>
{
Global.CustomRoutingListUrl + Global.agentTag,
Global.CustomRoutingListUrl + Global.directTag,
Global.CustomRoutingListUrl + Global.blockTag
};
List<TextBox> lstTxt = new List<TextBox>
{
txtUseragent,
txtUserdirect,
txtUserblock
};
for (int k = 0; k < lstUrl.Count; k++)
{
TextBox txt = lstTxt[k];
DownloadHandle downloadHandle = new DownloadHandle();
downloadHandle.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
string result = args.Msg;
if (Utils.IsNullOrEmpty(result))
{
return;
}
txt.Text = result;
}
else
{
AppendText(false, args.Msg);
}
};
downloadHandle.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
downloadHandle.WebDownloadString(lstUrl[k]);
}
}
void AppendText(bool notify, string text)
{
labRoutingTips.Text = text;
}
private void linkLabelRoutingDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://www.v2fly.org/chapter_02/03_routing.html");
}
}
class ComboItem
{
public int ID
{
get; set;
}
public string Text
{
get; set;
System.Diagnostics.Process.Start("https://www.v2fly.org/config/dns.html#dnsobject");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -120,43 +120,13 @@
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="chkdefAllowInsecure.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 16</value>
<value>336, 16</value>
</data>
<data name="chkdefAllowInsecure.Text" xml:space="preserve">
<value>底层传输安全选tls时默认跳过证书验证(allowInsecure)</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label16.Text" xml:space="preserve">
<value>Http代理</value>
</data>
<data name="cmblistenerType.Items" xml:space="preserve">
<value>关闭Http代理</value>
</data>
<data name="cmblistenerType.Items1" xml:space="preserve">
<value>开启Http代理,并自动配置系统代理(全局模式)</value>
</data>
<data name="cmblistenerType.Items2" xml:space="preserve">
<value>开启PAC,并自动配置系统代理(PAC模式)</value>
</data>
<data name="cmblistenerType.Items3" xml:space="preserve">
<value>仅开启Http代理,并清除系统代理</value>
</data>
<data name="cmblistenerType.Items4" xml:space="preserve">
<value>仅开启PAC,并清除系统代理</value>
</data>
<data name="cmblistenerType.Items5" xml:space="preserve">
<value>仅开启Http代理,不改变系统代理</value>
</data>
<data name="cmblistenerType.Items6" xml:space="preserve">
<value>仅开启PAC,不改变系统代理</value>
</data>
<data name="chksniffingEnabled2.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 16</value>
</data>
@ -169,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>
@ -226,106 +190,50 @@
<data name="label2.Text" xml:space="preserve">
<value>本地监听端口</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>648, 437</value>
</data>
<data name="tabPage1.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>161, 12</value>
</data>
<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>
<data name="tabPage2.Text" xml:space="preserve">
<value> Core:路由设置 </value>
<value> Core:DNS设置 </value>
</data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 89</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 481</value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 1.代理的Domain或IP </value>
</data>
<data name="txtUseragent.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
<data name="tabPage4.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage4.Text" xml:space="preserve">
<value> 2.直连的Domain或IP </value>
</data>
<data name="txtUserdirect.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
<data name="tabPage5.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage5.Text" xml:space="preserve">
<value> 3.阻止的Domain或IP </value>
</data>
<data name="txtUserblock.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
<data name="tabPage8.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage8.Text" xml:space="preserve">
<value> 4.预定义规则 </value>
</data>
<data name="cmbroutingMode.Items" xml:space="preserve">
<value>全局</value>
</data>
<data name="cmbroutingMode.Items1" xml:space="preserve">
<value>绕过局域网地址</value>
</data>
<data name="cmbroutingMode.Items2" xml:space="preserve">
<value>绕过大陆地址</value>
</data>
<data name="cmbroutingMode.Items3" xml:space="preserve">
<value>绕过局域网及大陆地址</value>
</data>
<data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 26</value>
</data>
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
<value>244, 20</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 72</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>
<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">
<value>NoControl</value>
</data>
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
<value>351, 14</value>
</data>
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>201, 23</value>
</data>
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
<value>一键设置默认自定义路由规则</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 49</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>383, 12</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </value>
</data>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
<data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>150, 16</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve">
<value>更新Core时忽略Geo文件</value>
</data>
<data name="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>
@ -351,27 +259,30 @@
<data name="chkAllowLANConn.Text" xml:space="preserve">
<value>允许来自局域网的连接</value>
</data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 12</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>自定义GFWList地址(不需自定义请填空白)</value>
</data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 16</value>
</data>
<data name="chkAutoRun.Text" xml:space="preserve">
<value>开机自动启动(可能会不成功)</value>
</data>
<data name="tabPage9.Text" xml:space="preserve">
<value> 用户PAC设置 </value>
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>*设置用户PAC规则用逗号(,)隔开</value>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 469</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 479</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>662, 539</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>参数设置</value>
</data>

View file

@ -24,7 +24,7 @@ namespace v2rayN.Forms
{
if (Index >= 0)
{
string url = ConfigHandler.GetVmessQRCode(config, Index);
string url = ShareHandler.GetShareUrl(config, Index);
if (Utils.IsNullOrEmpty(url))
{
picQRCode.Image = null;

View file

@ -0,0 +1,170 @@
namespace v2rayN.Forms
{
partial class RoutingRuleQuicklyAddForm
{
/// <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(RoutingRuleQuicklyAddForm));
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.label4 = new System.Windows.Forms.Label();
this.cmbOutboundTag = new System.Windows.Forms.ComboBox();
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.label4);
this.panel3.Controls.Add(this.cmbOutboundTag);
this.panel3.Name = "panel3";
//
// 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";
//
// 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";
//
// RoutingRuleQuicklyAddForm
//
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 = "RoutingRuleQuicklyAddForm";
this.Load += new System.EventHandler(this.RoutingRuleQuicklyAddForm_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.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;
}
}

View file

@ -0,0 +1,73 @@
using System;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingRuleQuicklyAddForm : BaseForm
{
public string domain
{
get; set;
}
private RulesItem rulesItem;
public RoutingRuleQuicklyAddForm()
{
InitializeComponent();
}
private void RoutingRuleQuicklyAddForm_Load(object sender, EventArgs e)
{
rulesItem = new RulesItem();
ClearBind();
}
private void EndBindingData()
{
if (rulesItem != null)
{
rulesItem.outboundTag = cmbOutboundTag.Text;
rulesItem.domain = Utils.String2List(txtDomain.Text);
rulesItem.ip = Utils.String2List(txtIP.Text);
}
}
private void ClearBind()
{
cmbOutboundTag.Text = Global.agentTag;
txtDomain.Text = domain;
}
private void btnOK_Click(object sender, EventArgs e)
{
EndBindingData();
var hasRule = false;
if (rulesItem.domain != null && rulesItem.domain.Count > 0)
{
hasRule = true;
}
if (rulesItem.ip != null && rulesItem.ip.Count > 0)
{
hasRule = true;
}
if (!hasRule)
{
return;
}
if (ConfigHandler.InsertRoutingRuleItem(ref config, rulesItem) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -0,0 +1,462 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="&gt;&gt;txtIP.Name" xml:space="preserve">
<value>txtIP</value>
</data>
<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>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel3.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cmbOutboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 20</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="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtDomain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtIP.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 207</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel4.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</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="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingRuleQuicklyAddForm</value>
</data>
<data name="&gt;&gt;panel4.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="panel4.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 288</value>
</data>
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="txtIP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="cmbOutboundTag.Items" xml:space="preserve">
<value>proxy</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Left</value>
</data>
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>506, 10</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>7</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="panel2.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Domain</value>
</data>
<data name="&gt;&gt;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="panel3.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;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;panel3.Name" xml:space="preserve">
<value>panel3</value>
</data>
<data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>506, 51</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;txtDomain.Name" xml:space="preserve">
<value>txtDomain</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="&gt;&gt;panel4.Name" xml:space="preserve">
<value>panel4</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>IP</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>280, 0</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="txtIP.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>outboundTag</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</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;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;panel3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>305, 25</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>506, 227</value>
</data>
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>280, 227</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="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<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;cmbOutboundTag.Name" xml:space="preserve">
<value>cmbOutboundTag</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>506, 60</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;label4.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="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>226, 227</value>
</data>
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 16</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>RoutingRuleQuicklyAddForm</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<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="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 20</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;panel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 61</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;panel4.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>274, 207</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>506, 348</value>
</data>
<data name="txtIP.TabIndex" type="System.Int32, mscorlib">
<value>25</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="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;groupBox2.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>398, 25</value>
</data>
<data name="txtIP.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>0</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>
<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

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

View file

@ -0,0 +1,218 @@
namespace v2rayN.Forms
{
partial class RoutingRuleSettingDetailsForm
{
/// <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(RoutingRuleSettingDetailsForm));
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.clbProtocol = new System.Windows.Forms.CheckedListBox();
this.label3 = new System.Windows.Forms.Label();
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.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
//
this.panel3.Controls.Add(this.clbProtocol);
this.panel3.Controls.Add(this.label3);
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);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
// clbProtocol
//
this.clbProtocol.CheckOnClick = true;
resources.ApplyResources(this.clbProtocol, "clbProtocol");
this.clbProtocol.FormattingEnabled = true;
this.clbProtocol.Items.AddRange(new object[] {
resources.GetString("clbProtocol.Items"),
resources.GetString("clbProtocol.Items1"),
resources.GetString("clbProtocol.Items2")});
this.clbProtocol.MultiColumn = true;
this.clbProtocol.Name = "clbProtocol";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// txtPort
//
resources.ApplyResources(this.txtPort, "txtPort");
this.txtPort.Name = "txtPort";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// labRoutingTips
//
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// 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")});
resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag");
this.cmbOutboundTag.Name = "cmbOutboundTag";
//
// panel4
//
this.panel4.Controls.Add(this.btnClose);
this.panel4.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4";
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
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
//
this.panel2.Controls.Add(this.groupBox2);
this.panel2.Controls.Add(this.groupBox1);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.txtIP);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// txtIP
//
resources.ApplyResources(this.txtIP, "txtIP");
this.txtIP.Name = "txtIP";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtDomain);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// txtDomain
//
resources.ApplyResources(this.txtDomain, "txtDomain");
this.txtDomain.Name = "txtDomain";
//
// RoutingRuleSettingDetailsForm
//
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 = "RoutingRuleSettingDetailsForm";
this.Load += new System.EventHandler(this.RoutingRuleSettingDetailsForm_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.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;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckedListBox clbProtocol;
}
}

View file

@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingRuleSettingDetailsForm : BaseForm
{
public RulesItem rulesItem
{
get; set;
}
public RoutingRuleSettingDetailsForm()
{
InitializeComponent();
}
private void RoutingRuleSettingDetailsForm_Load(object sender, EventArgs e)
{
if (Utils.IsNullOrEmpty(rulesItem.outboundTag))
{
ClearBind();
}
else
{
BindingData();
}
}
private void EndBindingData()
{
if (rulesItem != null)
{
rulesItem.port = txtPort.Text.TrimEx();
rulesItem.outboundTag = cmbOutboundTag.Text;
rulesItem.domain = Utils.String2List(txtDomain.Text);
rulesItem.ip = Utils.String2List(txtIP.Text);
var protocol = new List<string>();
for (int i = 0; i < clbProtocol.Items.Count; i++)
{
if (clbProtocol.GetItemChecked(i))
{
protocol.Add(clbProtocol.Items[i].ToString());
}
}
rulesItem.protocol = protocol;
}
}
private void BindingData()
{
if (rulesItem != null)
{
txtPort.Text = rulesItem.port ?? string.Empty;
cmbOutboundTag.Text = rulesItem.outboundTag;
txtDomain.Text = Utils.List2String(rulesItem.domain, true);
txtIP.Text = Utils.List2String(rulesItem.ip, true);
if (rulesItem.protocol != null)
{
for (int i = 0; i < clbProtocol.Items.Count; i++)
{
if (rulesItem.protocol.Contains(clbProtocol.Items[i].ToString()))
{
clbProtocol.SetItemChecked(i, true);
}
}
}
}
}
private void ClearBind()
{
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();
var hasRule = false;
if (rulesItem.domain != null && rulesItem.domain.Count > 0)
{
hasRule = true;
}
if (rulesItem.ip != null && rulesItem.ip.Count > 0)
{
hasRule = true;
}
if (rulesItem.protocol != null && rulesItem.protocol.Count > 0)
{
hasRule = true;
}
if (!Utils.IsNullOrEmpty(rulesItem.port))
{
hasRule = true;
}
if (!hasRule)
{
UI.ShowWarning(string.Format(UIRes.I18N("RoutingRuleDetailRequiredTips"), "Port/Protocol/Domain/IP"));
return;
}
this.DialogResult = DialogResult.OK;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -0,0 +1,603 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 10</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<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;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="clbProtocol.ColumnWidth" type="System.Int32, mscorlib">
<value>80</value>
</data>
<data name="clbProtocol.Items" xml:space="preserve">
<value>http</value>
</data>
<data name="clbProtocol.Items1" xml:space="preserve">
<value>tls</value>
</data>
<data name="clbProtocol.Items2" xml:space="preserve">
<value>bittorrent</value>
</data>
<data name="clbProtocol.Location" type="System.Drawing.Point, System.Drawing">
<value>347, 43</value>
</data>
<data name="clbProtocol.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 20</value>
</data>
<data name="clbProtocol.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="&gt;&gt;clbProtocol.Name" xml:space="preserve">
<value>clbProtocol</value>
</data>
<data name="&gt;&gt;clbProtocol.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;clbProtocol.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;clbProtocol.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 47</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>36</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Protocol</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</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="&gt;&gt;label3.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 43</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 21</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</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;txtPort.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 47</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Port</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="labRoutingTips.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 82</value>
</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>33</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*Set the rules, separated by commas (,); The comma in the regular is replaced by &lt;COMMA&gt;</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>panel3</value>
</data>
<data name="&gt;&gt;labRoutingTips.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 20</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>outboundTag</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</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;label4.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="cmbOutboundTag.Items" xml:space="preserve">
<value>proxy</value>
</data>
<data name="cmbOutboundTag.Items1" xml:space="preserve">
<value>direct</value>
</data>
<data name="cmbOutboundTag.Items2" xml:space="preserve">
<value>block</value>
</data>
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 16</value>
</data>
<data name="cmbOutboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 20</value>
</data>
<data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Name" xml:space="preserve">
<value>cmbOutboundTag</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;cmbOutboundTag.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="panel3.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 111</value>
</data>
<data name="panel3.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;panel3.Name" xml:space="preserve">
<value>panel3</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;panel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>504, 15</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>411, 15</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel4.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 516</value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 60</value>
</data>
<data name="panel4.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;panel4.Name" xml:space="preserve">
<value>panel4</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;panel4.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel4.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtIP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtIP.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtIP.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtIP.Size" type="System.Drawing.Size, System.Drawing">
<value>344, 375</value>
</data>
<data name="txtIP.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;txtIP.Name" xml:space="preserve">
<value>txtIP</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;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>392, 0</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>350, 395</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>IP</value>
</data>
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</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;groupBox2.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtDomain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 375</value>
</data>
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="&gt;&gt;txtDomain.Name" xml:space="preserve">
<value>txtDomain</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;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Left</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 395</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Domain</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 121</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 395</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<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>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>742, 576</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>RoutingSettingDetailsForm</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingRuleSettingDetailsForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的路由规则,用逗号(,)分隔;正则中的逗号用&lt;COMMA&gt;替代</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<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>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>路由规则详情设置</value>
</data>
</root>

View file

@ -0,0 +1,323 @@
namespace v2rayN.Forms
{
partial class RoutingRuleSettingForm
{
/// <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()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingRuleSettingForm));
this.btnClose = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.txtUrl = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
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.menuImportRulesFromFile = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportRulesFromClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportRulesFromUrl = 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
//
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);
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
this.panel2.Name = "panel2";
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.txtUrl);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.txtRemarks);
this.panel1.Controls.Add(this.label2);
this.panel1.Name = "panel1";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// txtUrl
//
resources.ApplyResources(this.txtUrl, "txtUrl");
this.txtUrl.Name = "txtUrl";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// txtRemarks
//
resources.ApplyResources(this.txtRemarks, "txtRemarks");
this.txtRemarks.Name = "txtRemarks";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// lvRoutings
//
resources.ApplyResources(this.lvRoutings, "lvRoutings");
this.lvRoutings.ContextMenuStrip = this.cmsLv;
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
//
resources.ApplyResources(this.cmsLv, "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";
this.cmsLv.OwnerItem = this.MenuItem1;
//
// menuAdd
//
resources.ApplyResources(this.menuAdd, "menuAdd");
this.menuAdd.Name = "menuAdd";
this.menuAdd.Click += new System.EventHandler(this.menuAdd_Click);
//
// menuRemove
//
resources.ApplyResources(this.menuRemove, "menuRemove");
this.menuRemove.Name = "menuRemove";
this.menuRemove.Click += new System.EventHandler(this.menuRemove_Click);
//
// menuSelectAll
//
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Name = "menuSelectAll";
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
//
// menuExportSelectedRules
//
resources.ApplyResources(this.menuExportSelectedRules, "menuExportSelectedRules");
this.menuExportSelectedRules.Name = "menuExportSelectedRules";
this.menuExportSelectedRules.Click += new System.EventHandler(this.menuExportSelectedRules_Click);
//
// toolStripSeparator3
//
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
this.toolStripSeparator3.Name = "toolStripSeparator3";
//
// menuMoveTop
//
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
this.menuMoveTop.Name = "menuMoveTop";
this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click);
//
// menuMoveUp
//
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
this.menuMoveUp.Name = "menuMoveUp";
this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click);
//
// menuMoveDown
//
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
this.menuMoveDown.Name = "menuMoveDown";
this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click);
//
// menuMoveBottom
//
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
this.menuMoveBottom.Name = "menuMoveBottom";
this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click);
//
// MenuItem1
//
resources.ApplyResources(this.MenuItem1, "MenuItem1");
this.MenuItem1.DropDown = this.cmsLv;
this.MenuItem1.Name = "MenuItem1";
//
// tabControl2
//
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Controls.Add(this.tabPage2);
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
//
// tabPage2
//
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Controls.Add(this.lvRoutings);
this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// menuServer
//
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItem1,
this.toolStripMenuItem1});
this.menuServer.Name = "menuServer";
//
// toolStripMenuItem1
//
resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1");
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuImportRulesFromFile,
this.menuImportRulesFromClipboard,
this.menuImportRulesFromUrl});
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
//
// menuImportRulesFromFile
//
resources.ApplyResources(this.menuImportRulesFromFile, "menuImportRulesFromFile");
this.menuImportRulesFromFile.Name = "menuImportRulesFromFile";
this.menuImportRulesFromFile.Click += new System.EventHandler(this.menuImportRulesFromFile_Click);
//
// menuImportRulesFromClipboard
//
resources.ApplyResources(this.menuImportRulesFromClipboard, "menuImportRulesFromClipboard");
this.menuImportRulesFromClipboard.Name = "menuImportRulesFromClipboard";
this.menuImportRulesFromClipboard.Click += new System.EventHandler(this.menuImportRulesFromClipboard_Click);
//
// menuImportRulesFromUrl
//
resources.ApplyResources(this.menuImportRulesFromUrl, "menuImportRulesFromUrl");
this.menuImportRulesFromUrl.Name = "menuImportRulesFromUrl";
this.menuImportRulesFromUrl.Click += new System.EventHandler(this.menuImportRulesFromUrl_Click);
//
// RoutingRuleSettingForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
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 = "RoutingRuleSettingForm";
this.Load += new System.EventHandler(this.RoutingRuleSettingForm_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();
}
#endregion
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel1;
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 menuImportRulesFromFile;
private System.Windows.Forms.ToolStripMenuItem menuImportRulesFromClipboard;
private System.Windows.Forms.ToolStripMenuItem menuExportSelectedRules;
private System.Windows.Forms.ToolStripMenuItem menuImportRulesFromUrl;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtUrl;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label1;
}
}

View file

@ -0,0 +1,334 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingRuleSettingForm : BaseForm
{
public int EditIndex
{
get; set;
}
protected RoutingItem routingItem = null;
private List<int> lvSelecteds = new List<int>();
public RoutingRuleSettingForm()
{
InitializeComponent();
}
private void RoutingRuleSettingForm_Load(object sender, EventArgs e)
{
if (EditIndex >= 0)
{
routingItem = config.routings[EditIndex];
}
else
{
routingItem = new RoutingItem();
}
if (routingItem.rules == null)
{
routingItem.rules = new List<RulesItem>();
}
txtRemarks.Text = routingItem.remarks ?? string.Empty;
txtUrl.Text = routingItem.url ?? string.Empty;
InitRoutingsView();
RefreshRoutingsView();
}
private void InitRoutingsView()
{
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
lvRoutings.GridLines = true;
lvRoutings.FullRowSelect = true;
lvRoutings.View = View.Details;
lvRoutings.MultiSelect = true;
lvRoutings.HeaderStyle = ColumnHeaderStyle.Clickable;
lvRoutings.Columns.Add("", 30);
lvRoutings.Columns.Add("outboundTag", 80);
lvRoutings.Columns.Add("port", 80);
lvRoutings.Columns.Add("protocol", 100);
lvRoutings.Columns.Add("domain", 160);
lvRoutings.Columns.Add("ip", 160);
lvRoutings.EndUpdate();
}
private void RefreshRoutingsView()
{
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
for (int k = 0; k < routingItem.rules.Count; k++)
{
var item = routingItem.rules[k];
ListViewItem lvItem = new ListViewItem("");
Utils.AddSubItem(lvItem, "outboundTag", item.outboundTag);
Utils.AddSubItem(lvItem, "port", item.port);
Utils.AddSubItem(lvItem, "protocol", Utils.List2String(item.protocol));
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)
{
routingItem.remarks = txtRemarks.Text.Trim();
routingItem.url = txtUrl.Text.Trim();
if (ConfigHandler.AddRoutingItem(ref config, routingItem, EditIndex) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
private void lvRoutings_DoubleClick(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
var fm = new RoutingRuleSettingDetailsForm();
fm.rulesItem = routingItem.rules[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 routingItem, 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 RoutingRuleSettingDetailsForm();
fm.rulesItem = new RulesItem();
if (fm.ShowDialog() == DialogResult.OK)
{
routingItem.rules.Insert(0, fm.rulesItem);
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--)
{
routingItem.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(routingItem.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 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 routingItem, result) == 0)
{
RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
private void menuImportRulesFromClipboard_Click(object sender, EventArgs e)
{
string clipboardData = Utils.GetClipboardData();
if (ConfigHandler.AddBatchRoutingRules(ref routingItem, clipboardData) == 0)
{
RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
private void menuImportRulesFromUrl_Click(object sender, EventArgs e)
{
var url = txtUrl.Text.Trim();
if (Utils.IsNullOrEmpty(url))
{
UI.Show(UIRes.I18N("MsgNeedUrl"));
return;
}
DownloadHandle downloadHandle = new DownloadHandle();
string clipboardData = downloadHandle.WebDownloadStringSync(url);
if (ConfigHandler.AddBatchRoutingRules(ref routingItem, clipboardData) == 0)
{
RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
#endregion
}
}

View file

@ -0,0 +1,671 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="&gt;&gt;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;txtUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, 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="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>199, 6</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="lvRoutings.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;menuImportRulesFromUrl.Name" xml:space="preserve">
<value>menuImportRulesFromUrl</value>
</data>
<data name="menuMoveDown.Text" xml:space="preserve">
<value>Down (D)</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>762, 25</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="&gt;&gt;txtUrl.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Edit and Function</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;menuServer.Parent" xml:space="preserve">
<value>$this</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="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="&gt;&gt;menuServer.ZOrder" xml:space="preserve">
<value>4</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;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;label3.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="menuServer.TabIndex" type="System.Int32, mscorlib">
<value>15</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;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="tabPage2.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
</data>
<data name="&gt;&gt;tabControl2.Parent" xml:space="preserve">
<value>$this</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="$this.Text" xml:space="preserve">
<value>Rule Settings</value>
</data>
<data name="menuRemove.Text" xml:space="preserve">
<value>Remove selected</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;tabPage2.Name" xml:space="preserve">
<value>tabPage2</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="menuExportSelectedRules.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>475, 17</value>
</data>
<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="label3.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="&gt;&gt;MenuItem1.Name" xml:space="preserve">
<value>MenuItem1</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>754, 362</value>
</data>
<data name="&gt;&gt;tabControl2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>568, 17</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;label2.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="tabControl2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="menuServer.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>762, 60</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Sub Url</value>
</data>
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 21</value>
</data>
<data name="&gt;&gt;txtUrl.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;menuServer.Name" xml:space="preserve">
<value>menuServer</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="menuImportRulesFromUrl.Text" xml:space="preserve">
<value>Import Rules From Sub Url</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;menuSelectAll.Name" xml:space="preserve">
<value>menuSelectAll</value>
</data>
<data name="&gt;&gt;menuMoveTop.Name" xml:space="preserve">
<value>menuMoveTop</value>
</data>
<data name="menuMoveBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="&gt;&gt;cmsLv.Name" xml:space="preserve">
<value>cmsLv</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;menuImportRulesFromFile.Name" xml:space="preserve">
<value>menuImportRulesFromFile</value>
</data>
<data name="menuAdd.Text" xml:space="preserve">
<value>Add</value>
</data>
<data name="lvRoutings.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="&gt;&gt;toolStripSeparator3.Name" xml:space="preserve">
<value>toolStripSeparator3</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;lvRoutings.Parent" xml:space="preserve">
<value>tabPage2</value>
</data>
<data name="&gt;&gt;toolStripMenuItem1.Name" xml:space="preserve">
<value>toolStripMenuItem1</value>
</data>
<data name="&gt;&gt;menuMoveBottom.Name" xml:space="preserve">
<value>menuMoveBottom</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 25</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>18, 63</value>
</data>
<data name="menuImportRulesFromFile.Text" xml:space="preserve">
<value>Import Rules From File</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>762, 388</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>RoutingRuleSettingForm</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</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;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;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="menuMoveUp.Text" xml:space="preserve">
<value>Up (U)</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 186</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="tabControl2.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</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;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="lvRoutings.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="&gt;&gt;menuImportRulesFromClipboard.Name" xml:space="preserve">
<value>menuImportRulesFromClipboard</value>
</data>
<data name="menuImportRulesFromClipboard.Text" xml:space="preserve">
<value>Import Rules From Clipboard</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;menuAdd.Name" xml:space="preserve">
<value>menuAdd</value>
</data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 127</value>
</data>
<data name="menuImportRulesFromFile.Size" type="System.Drawing.Size, System.Drawing">
<value>247, 22</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="menuMoveTop.Text" xml:space="preserve">
<value>Move to top (T)</value>
</data>
<data name="&gt;&gt;menuImportRulesFromUrl.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="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>762, 102</value>
</data>
<data name="&gt;&gt;txtUrl.Name" xml:space="preserve">
<value>txtUrl</value>
</data>
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>748, 356</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</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="txtUrl.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;lvRoutings.Name" xml:space="preserve">
<value>lvRoutings</value>
</data>
<data name="menuImportRulesFromUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>247, 22</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>35</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="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>18, 45</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>91, 45</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>166, 21</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="txtUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>644, 48</value>
</data>
<data name="&gt;&gt;menuMoveDown.Name" xml:space="preserve">
<value>menuMoveDown</value>
</data>
<data name="menuAdd.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="menuMoveBottom.Text" xml:space="preserve">
<value>Move to bottom (B)</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</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="panel1.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel1</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="&gt;&gt;tabPage2.Parent" xml:space="preserve">
<value>tabControl2</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</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="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="tabPage2.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 515</value>
</data>
<data name="&gt;&gt;menuMoveUp.Name" xml:space="preserve">
<value>menuMoveUp</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value>RuleList</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>Select All (Ctrl+A)</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="&gt;&gt;menuExportSelectedRules.Name" xml:space="preserve">
<value>menuExportSelectedRules</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Optional</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>91, 13</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="menuImportRulesFromClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>247, 22</value>
</data>
<data name="menuRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</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;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="&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="menuMoveUp.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;menuRemove.Name" xml:space="preserve">
<value>menuRemove</value>
</data>
<data name="txtUrl.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>18, 13</value>
</data>
<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>762, 575</value>
</data>
<data name="toolStripMenuItem1.Text" xml:space="preserve">
<value>Import Rules</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="tabPage2.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;tabControl2.Name" xml:space="preserve">
<value>tabControl2</value>
</data>
<data name="&gt;&gt;tabPage2.ZOrder" xml:space="preserve">
<value>0</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="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</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="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;lvRoutings.ZOrder" xml:space="preserve">
<value>0</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>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cmsLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>139, 17</value>
</metadata>
</root>

View file

@ -0,0 +1,285 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 613</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 60</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>可选</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>101, 45</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>订阅地址(Url)</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>101, 13</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>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 109</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>68, 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, 447</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>777, 453</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value>规则列表</value>
</data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 134</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 479</value>
</data>
<data name="menuImportRulesFromFile.Size" type="System.Drawing.Size, System.Drawing">
<value>189, 22</value>
</data>
<data name="menuImportRulesFromFile.Text" xml:space="preserve">
<value>从文件中导入规则</value>
</data>
<data name="menuImportRulesFromClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>189, 22</value>
</data>
<data name="menuImportRulesFromClipboard.Text" xml:space="preserve">
<value>从剪贴板中导入规则</value>
</data>
<data name="menuImportRulesFromUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>189, 22</value>
</data>
<data name="menuImportRulesFromUrl.Text" xml:space="preserve">
<value>从订阅Url中导入规则</value>
</data>
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 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>
</root>

View file

@ -0,0 +1,234 @@
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.clbProtocol = new System.Windows.Forms.CheckedListBox();
this.label3 = new System.Windows.Forms.Label();
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
//
this.panel3.Controls.Add(this.clbProtocol);
this.panel3.Controls.Add(this.label3);
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);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
// clbProtocol
//
this.clbProtocol.CheckOnClick = true;
resources.ApplyResources(this.clbProtocol, "clbProtocol");
this.clbProtocol.FormattingEnabled = true;
this.clbProtocol.Items.AddRange(new object[] {
resources.GetString("clbProtocol.Items"),
resources.GetString("clbProtocol.Items1"),
resources.GetString("clbProtocol.Items2")});
this.clbProtocol.MultiColumn = true;
this.clbProtocol.Name = "clbProtocol";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// txtPort
//
resources.ApplyResources(this.txtPort, "txtPort");
this.txtPort.Name = "txtPort";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// labRoutingTips
//
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// 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")});
resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag");
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
//
this.panel4.Controls.Add(this.btnClose);
this.panel4.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4";
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
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
//
this.panel2.Controls.Add(this.groupBox2);
this.panel2.Controls.Add(this.groupBox1);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.txtIP);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// txtIP
//
resources.ApplyResources(this.txtIP, "txtIP");
this.txtIP.Name = "txtIP";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtDomain);
resources.ApplyResources(this.groupBox1, "groupBox1");
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;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckedListBox clbProtocol;
}
}

View file

@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
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);
var protocol = new List<string>();
for (int i = 0; i < clbProtocol.Items.Count; i++)
{
if (clbProtocol.GetItemChecked(i))
{
protocol.Add(clbProtocol.Items[i].ToString());
}
}
routingItem.protocol = protocol;
}
}
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);
if (routingItem.protocol != null)
{
for (int i = 0; i < clbProtocol.Items.Count; i++)
{
if (routingItem.protocol.Contains(clbProtocol.Items[i].ToString()))
{
clbProtocol.SetItemChecked(i, 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();
var hasRule = false;
if (routingItem.domain != null && routingItem.domain.Count > 0)
{
hasRule = true;
}
if (routingItem.ip != null && routingItem.ip.Count > 0)
{
hasRule = true;
}
if (routingItem.protocol != null && routingItem.protocol.Count > 0)
{
hasRule = true;
}
if (!Utils.IsNullOrEmpty(routingItem.port))
{
hasRule = true;
}
if (!hasRule)
{
UI.ShowWarning(string.Format(UIRes.I18N("RoutingRuleDetailRequiredTips"), "Port/Protocol/Domain/IP"));
return;
}
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

@ -0,0 +1,723 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 10</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<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;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="clbProtocol.ColumnWidth" type="System.Int32, mscorlib">
<value>80</value>
</data>
<data name="clbProtocol.Items" xml:space="preserve">
<value>http</value>
</data>
<data name="clbProtocol.Items1" xml:space="preserve">
<value>tls</value>
</data>
<data name="clbProtocol.Items2" xml:space="preserve">
<value>bittorrent</value>
</data>
<data name="clbProtocol.Location" type="System.Drawing.Point, System.Drawing">
<value>347, 43</value>
</data>
<data name="clbProtocol.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 20</value>
</data>
<data name="clbProtocol.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="&gt;&gt;clbProtocol.Name" xml:space="preserve">
<value>clbProtocol</value>
</data>
<data name="&gt;&gt;clbProtocol.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;clbProtocol.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;clbProtocol.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 47</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>36</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Protocol</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</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="&gt;&gt;label3.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>84, 43</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>166, 21</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</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;txtPort.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 47</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Port</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="labRoutingTips.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 82</value>
</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>33</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*Set the rules, separated by commas (,); The comma in the regular is replaced by &lt;COMMA&gt;</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>panel3</value>
</data>
<data name="&gt;&gt;labRoutingTips.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 20</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>Out Tag</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</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;label4.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="cmbOutboundTag.Items" xml:space="preserve">
<value>proxy</value>
</data>
<data name="cmbOutboundTag.Items1" xml:space="preserve">
<value>direct</value>
</data>
<data name="cmbOutboundTag.Items2" xml:space="preserve">
<value>block</value>
</data>
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>347, 16</value>
</data>
<data name="cmbOutboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 20</value>
</data>
<data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Name" xml:space="preserve">
<value>cmbOutboundTag</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;cmbOutboundTag.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>84, 16</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>166, 21</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 20</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</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="&gt;&gt;label2.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="panel3.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 111</value>
</data>
<data name="panel3.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;panel3.Name" xml:space="preserve">
<value>panel3</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;panel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel4.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 516</value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 60</value>
</data>
<data name="panel4.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;panel4.Name" xml:space="preserve">
<value>panel4</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;panel4.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel4.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>504, 15</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>411, 15</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</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;groupBox2.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 121</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 395</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;txtIP.Name" xml:space="preserve">
<value>txtIP</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;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>392, 0</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>350, 395</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>IP</value>
</data>
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</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;groupBox2.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtIP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtIP.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtIP.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtIP.Size" type="System.Drawing.Size, System.Drawing">
<value>344, 375</value>
</data>
<data name="txtIP.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;txtIP.Name" xml:space="preserve">
<value>txtIP</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;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;txtDomain.Name" xml:space="preserve">
<value>txtDomain</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;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Left</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 395</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Domain</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtDomain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 375</value>
</data>
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="&gt;&gt;txtDomain.Name" xml:space="preserve">
<value>txtDomain</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;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>742, 576</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>RoutingSettingDetailsForm</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingSettingDetailsForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的路由规则,用逗号(,)分隔;正则中的逗号用&lt;COMMA&gt;替代</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<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>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>路由规则详情设置</value>
</data>
</root>

View file

@ -0,0 +1,447 @@
namespace v2rayN.Forms
{
partial class RoutingSettingForm
{
/// <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()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingSettingForm));
this.btnClose = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.labRoutingTips = new System.Windows.Forms.Label();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.chkenableRoutingAdvanced = new System.Windows.Forms.CheckBox();
this.linkLabelRoutingDoc = new System.Windows.Forms.LinkLabel();
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
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.menuSetDefaultRouting = new System.Windows.Forms.ToolStripMenuItem();
this.MenuItemAdvanced = new System.Windows.Forms.ToolStripMenuItem();
this.menuServer = new System.Windows.Forms.MenuStrip();
this.MenuItemBasic = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportBasicRules = new System.Windows.Forms.ToolStripMenuItem();
this.tabNormal = new System.Windows.Forms.TabControl();
this.tabPageProxy = new System.Windows.Forms.TabPage();
this.panel5 = new System.Windows.Forms.Panel();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.txtProxyIp = new System.Windows.Forms.TextBox();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.txtProxyDomain = new System.Windows.Forms.TextBox();
this.tabPageDirect = new System.Windows.Forms.TabPage();
this.panel4 = new System.Windows.Forms.Panel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.txtDirectIp = new System.Windows.Forms.TextBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.txtDirectDomain = new System.Windows.Forms.TextBox();
this.tabPageBlock = new System.Windows.Forms.TabPage();
this.panel3 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtBlockIp = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtBlockDomain = new System.Windows.Forms.TextBox();
this.tabPageRuleList = new System.Windows.Forms.TabPage();
this.lvRoutings = new v2rayN.Base.ListViewFlickerFree();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.cmsLv.SuspendLayout();
this.menuServer.SuspendLayout();
this.tabNormal.SuspendLayout();
this.tabPageProxy.SuspendLayout();
this.panel5.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox6.SuspendLayout();
this.tabPageDirect.SuspendLayout();
this.panel4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.tabPageBlock.SuspendLayout();
this.panel3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPageRuleList.SuspendLayout();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// panel2
//
this.panel2.Controls.Add(this.labRoutingTips);
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// labRoutingTips
//
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips";
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel1
//
this.panel1.Controls.Add(this.chkenableRoutingAdvanced);
this.panel1.Controls.Add(this.linkLabelRoutingDoc);
this.panel1.Controls.Add(this.cmbdomainStrategy);
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// chkenableRoutingAdvanced
//
resources.ApplyResources(this.chkenableRoutingAdvanced, "chkenableRoutingAdvanced");
this.chkenableRoutingAdvanced.Name = "chkenableRoutingAdvanced";
this.chkenableRoutingAdvanced.UseVisualStyleBackColor = true;
this.chkenableRoutingAdvanced.CheckedChanged += new System.EventHandler(this.chkenableRoutingAdvanced_CheckedChanged_1);
//
// 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);
//
// cmbdomainStrategy
//
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainStrategy.FormattingEnabled = true;
this.cmbdomainStrategy.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy.Items"),
resources.GetString("cmbdomainStrategy.Items1"),
resources.GetString("cmbdomainStrategy.Items2")});
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
//
// 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.menuSetDefaultRouting});
this.cmsLv.Name = "cmsLv";
this.cmsLv.OwnerItem = this.MenuItemAdvanced;
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);
//
// menuSetDefaultRouting
//
this.menuSetDefaultRouting.Name = "menuSetDefaultRouting";
resources.ApplyResources(this.menuSetDefaultRouting, "menuSetDefaultRouting");
this.menuSetDefaultRouting.Click += new System.EventHandler(this.menuSetDefaultRouting_Click);
//
// MenuItemAdvanced
//
this.MenuItemAdvanced.DropDown = this.cmsLv;
this.MenuItemAdvanced.Name = "MenuItemAdvanced";
resources.ApplyResources(this.MenuItemAdvanced, "MenuItemAdvanced");
//
// menuServer
//
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItemBasic,
this.MenuItemAdvanced});
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Name = "menuServer";
//
// MenuItemBasic
//
this.MenuItemBasic.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuImportBasicRules});
this.MenuItemBasic.Name = "MenuItemBasic";
resources.ApplyResources(this.MenuItemBasic, "MenuItemBasic");
//
// menuImportBasicRules
//
this.menuImportBasicRules.Name = "menuImportBasicRules";
resources.ApplyResources(this.menuImportBasicRules, "menuImportBasicRules");
this.menuImportBasicRules.Click += new System.EventHandler(this.menuImportBasicRules_Click);
//
// tabNormal
//
this.tabNormal.Controls.Add(this.tabPageProxy);
this.tabNormal.Controls.Add(this.tabPageDirect);
this.tabNormal.Controls.Add(this.tabPageBlock);
this.tabNormal.Controls.Add(this.tabPageRuleList);
resources.ApplyResources(this.tabNormal, "tabNormal");
this.tabNormal.Name = "tabNormal";
this.tabNormal.SelectedIndex = 0;
this.tabNormal.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.tabNormal_Selecting);
//
// tabPageProxy
//
this.tabPageProxy.Controls.Add(this.panel5);
resources.ApplyResources(this.tabPageProxy, "tabPageProxy");
this.tabPageProxy.Name = "tabPageProxy";
this.tabPageProxy.UseVisualStyleBackColor = true;
//
// panel5
//
this.panel5.Controls.Add(this.groupBox5);
this.panel5.Controls.Add(this.groupBox6);
resources.ApplyResources(this.panel5, "panel5");
this.panel5.Name = "panel5";
//
// groupBox5
//
this.groupBox5.Controls.Add(this.txtProxyIp);
resources.ApplyResources(this.groupBox5, "groupBox5");
this.groupBox5.Name = "groupBox5";
this.groupBox5.TabStop = false;
//
// txtProxyIp
//
resources.ApplyResources(this.txtProxyIp, "txtProxyIp");
this.txtProxyIp.Name = "txtProxyIp";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.txtProxyDomain);
resources.ApplyResources(this.groupBox6, "groupBox6");
this.groupBox6.Name = "groupBox6";
this.groupBox6.TabStop = false;
//
// txtProxyDomain
//
resources.ApplyResources(this.txtProxyDomain, "txtProxyDomain");
this.txtProxyDomain.Name = "txtProxyDomain";
//
// tabPageDirect
//
this.tabPageDirect.Controls.Add(this.panel4);
resources.ApplyResources(this.tabPageDirect, "tabPageDirect");
this.tabPageDirect.Name = "tabPageDirect";
this.tabPageDirect.UseVisualStyleBackColor = true;
//
// panel4
//
this.panel4.Controls.Add(this.groupBox3);
this.panel4.Controls.Add(this.groupBox4);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.txtDirectIp);
resources.ApplyResources(this.groupBox3, "groupBox3");
this.groupBox3.Name = "groupBox3";
this.groupBox3.TabStop = false;
//
// txtDirectIp
//
resources.ApplyResources(this.txtDirectIp, "txtDirectIp");
this.txtDirectIp.Name = "txtDirectIp";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.txtDirectDomain);
resources.ApplyResources(this.groupBox4, "groupBox4");
this.groupBox4.Name = "groupBox4";
this.groupBox4.TabStop = false;
//
// txtDirectDomain
//
resources.ApplyResources(this.txtDirectDomain, "txtDirectDomain");
this.txtDirectDomain.Name = "txtDirectDomain";
//
// tabPageBlock
//
this.tabPageBlock.Controls.Add(this.panel3);
resources.ApplyResources(this.tabPageBlock, "tabPageBlock");
this.tabPageBlock.Name = "tabPageBlock";
this.tabPageBlock.UseVisualStyleBackColor = true;
//
// panel3
//
this.panel3.Controls.Add(this.groupBox2);
this.panel3.Controls.Add(this.groupBox1);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.txtBlockIp);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// txtBlockIp
//
resources.ApplyResources(this.txtBlockIp, "txtBlockIp");
this.txtBlockIp.Name = "txtBlockIp";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtBlockDomain);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// txtBlockDomain
//
resources.ApplyResources(this.txtBlockDomain, "txtBlockDomain");
this.txtBlockDomain.Name = "txtBlockDomain";
//
// tabPageRuleList
//
this.tabPageRuleList.Controls.Add(this.lvRoutings);
resources.ApplyResources(this.tabPageRuleList, "tabPageRuleList");
this.tabPageRuleList.Name = "tabPageRuleList";
this.tabPageRuleList.UseVisualStyleBackColor = true;
//
// 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);
//
// RoutingSettingForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.tabNormal);
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.menuServer.ResumeLayout(false);
this.menuServer.PerformLayout();
this.tabNormal.ResumeLayout(false);
this.tabPageProxy.ResumeLayout(false);
this.panel5.ResumeLayout(false);
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.tabPageDirect.ResumeLayout(false);
this.panel4.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.tabPageBlock.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabPageRuleList.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.LinkLabel linkLabelRoutingDoc;
private System.Windows.Forms.ComboBox cmbdomainStrategy;
private System.Windows.Forms.ContextMenuStrip cmsLv;
private System.Windows.Forms.ToolStripMenuItem menuRemove;
private System.Windows.Forms.ToolStripMenuItem menuSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuAdd;
private System.Windows.Forms.MenuStrip menuServer;
private System.Windows.Forms.ToolStripMenuItem MenuItemAdvanced;
private System.Windows.Forms.ToolStripMenuItem menuSetDefaultRouting;
private System.Windows.Forms.TabControl tabNormal;
private System.Windows.Forms.TabPage tabPageProxy;
private System.Windows.Forms.TabPage tabPageDirect;
private System.Windows.Forms.TabPage tabPageBlock;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.TextBox txtProxyIp;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.TextBox txtProxyDomain;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox txtDirectIp;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TextBox txtDirectDomain;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtBlockIp;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtBlockDomain;
private System.Windows.Forms.TabPage tabPageRuleList;
private Base.ListViewFlickerFree lvRoutings;
private System.Windows.Forms.Label labRoutingTips;
private System.Windows.Forms.CheckBox chkenableRoutingAdvanced;
private System.Windows.Forms.ToolStripMenuItem MenuItemBasic;
private System.Windows.Forms.ToolStripMenuItem menuImportBasicRules;
}
}

View file

@ -0,0 +1,302 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingSettingForm : BaseForm
{
private List<int> lvSelecteds = new List<int>();
private RoutingItem lockedItem;
public RoutingSettingForm()
{
InitializeComponent();
}
private void RoutingSettingForm_Load(object sender, EventArgs e)
{
ConfigHandler.InitBuiltinRouting(ref config);
cmbdomainStrategy.Text = config.domainStrategy;
chkenableRoutingAdvanced.Checked = config.enableRoutingAdvanced;
if (config.routings == null)
{
config.routings = new List<RoutingItem>();
}
InitRoutingsView();
RefreshRoutingsView();
BindingLockedData();
InitUI();
}
private void tabNormal_Selecting(object sender, TabControlCancelEventArgs e)
{
//if (tabNormal.SelectedTab == tabPageRuleList)
//{
// MenuItem1.Enabled = true;
//}
//else
//{
// MenuItem1.Enabled = false;
//}
}
private void btnOK_Click(object sender, EventArgs e)
{
config.domainStrategy = cmbdomainStrategy.Text;
config.enableRoutingAdvanced = chkenableRoutingAdvanced.Checked;
EndBindingLockedData();
if (ConfigHandler.SaveRouting(ref config) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
private void chkenableRoutingAdvanced_CheckedChanged_1(object sender, EventArgs e)
{
InitUI();
}
private void InitUI()
{
if (chkenableRoutingAdvanced.Checked)
{
this.tabPageProxy.Parent = null;
this.tabPageDirect.Parent = null;
this.tabPageBlock.Parent = null;
this.tabPageRuleList.Parent = tabNormal;
MenuItemBasic.Enabled = false;
MenuItemAdvanced.Enabled = true;
}
else
{
this.tabPageProxy.Parent = tabNormal;
this.tabPageDirect.Parent = tabNormal;
this.tabPageBlock.Parent = tabNormal;
this.tabPageRuleList.Parent = null;
MenuItemBasic.Enabled = true;
MenuItemAdvanced.Enabled = false;
}
}
#region locked
private void BindingLockedData()
{
lockedItem = ConfigHandler.GetLockedRoutingItem(ref config);
if (lockedItem != null)
{
txtProxyDomain.Text = Utils.List2String(lockedItem.rules[0].domain, true);
txtProxyIp.Text = Utils.List2String(lockedItem.rules[0].ip, true);
txtDirectDomain.Text = Utils.List2String(lockedItem.rules[1].domain, true);
txtDirectIp.Text = Utils.List2String(lockedItem.rules[1].ip, true);
txtBlockDomain.Text = Utils.List2String(lockedItem.rules[2].domain, true);
txtBlockIp.Text = Utils.List2String(lockedItem.rules[2].ip, true);
}
}
private void EndBindingLockedData()
{
if (lockedItem != null)
{
lockedItem.rules[0].domain = Utils.String2List(txtProxyDomain.Text.TrimEx());
lockedItem.rules[0].ip = Utils.String2List(txtProxyIp.Text.TrimEx());
lockedItem.rules[1].domain = Utils.String2List(txtDirectDomain.Text.TrimEx());
lockedItem.rules[1].ip = Utils.String2List(txtDirectIp.Text.TrimEx());
lockedItem.rules[2].domain = Utils.String2List(txtBlockDomain.Text.TrimEx());
lockedItem.rules[2].ip = Utils.String2List(txtBlockIp.Text.TrimEx());
}
}
#endregion
#region ListView
private void InitRoutingsView()
{
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
lvRoutings.GridLines = true;
lvRoutings.FullRowSelect = true;
lvRoutings.View = View.Details;
lvRoutings.MultiSelect = true;
lvRoutings.HeaderStyle = ColumnHeaderStyle.Clickable;
lvRoutings.Columns.Add("", 30);
lvRoutings.Columns.Add(UIRes.I18N("LvAlias"), 200);
lvRoutings.Columns.Add(UIRes.I18N("LvCount"), 60);
lvRoutings.Columns.Add(UIRes.I18N("LvUrl"), 240);
lvRoutings.EndUpdate();
}
private void RefreshRoutingsView()
{
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
for (int k = 0; k < config.routings.Count; k++)
{
var item = config.routings[k];
if (item.locked == true)
{
continue;
}
string def = string.Empty;
if (config.routingIndex.Equals(k))
{
def = "√";
}
ListViewItem lvItem = new ListViewItem(def);
Utils.AddSubItem(lvItem, "remarks", item.remarks);
Utils.AddSubItem(lvItem, "count", item.rules.Count.ToString());
Utils.AddSubItem(lvItem, "url", item.url);
if (lvItem != null) lvRoutings.Items.Add(lvItem);
}
lvRoutings.EndUpdate();
}
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 RoutingRuleSettingForm();
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;
}
}
#endregion
#region Edit function
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 RoutingRuleSettingForm();
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.routings.RemoveAt(index);
}
RefreshRoutingsView();
}
private void menuSetDefaultRouting_Click(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
SetDefaultRouting(index);
}
private int SetDefaultRouting(int index)
{
if (index < 0)
{
UI.Show(UIRes.I18N("PleaseSelectServer"));
return -1;
}
if (ConfigHandler.SetDefaultRouting(ref config, index) == 0)
{
RefreshRoutingsView();
}
return 0;
}
private void menuImportBasicRules_Click(object sender, EventArgs e)
{
//Extra to bypass the mainland
txtDirectDomain.Text = "geosite:cn";
txtDirectIp.Text = "geoip:private,geoip:cn";
txtBlockDomain.Text = "geosite:category-ads-all";
}
#endregion
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,306 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>691, 17</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 545</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 60</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>518, 16</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的路由规则,用逗号(,)分隔;正则中的逗号用&lt;COMMA&gt;替代</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>598, 17</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 51</value>
</data>
<data name="chkenableRoutingAdvanced.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 16</value>
</data>
<data name="chkenableRoutingAdvanced.Text" xml:space="preserve">
<value>启用路由高级功能</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="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 92</value>
</data>
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="menuAdd.Text" xml:space="preserve">
<value>添加规则集</value>
</data>
<data name="menuRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="menuRemove.Text" xml:space="preserve">
<value>移除所选规则</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>全选</value>
</data>
<data name="menuSetDefaultRouting.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="menuSetDefaultRouting.Text" xml:space="preserve">
<value>设为活动路由</value>
</data>
<data name="MenuItemAdvanced.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 21</value>
</data>
<data name="MenuItemAdvanced.Text" xml:space="preserve">
<value>高级功能</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 25</value>
</data>
<data name="MenuItemBasic.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 21</value>
</data>
<data name="MenuItemBasic.Text" xml:space="preserve">
<value>基础功能</value>
</data>
<data name="menuImportBasicRules.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
</data>
<data name="menuImportBasicRules.Text" xml:space="preserve">
<value>一键导入基础规则</value>
</data>
<data name="tabNormal.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 469</value>
</data>
<data name="tabPageProxy.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageProxy.Text" xml:space="preserve">
<value> 1.代理的Domain或IP </value>
</data>
<data name="panel5.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="groupBox5.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtProxyIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
</data>
<data name="groupBox6.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="txtProxyDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="tabPageDirect.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageDirect.Text" xml:space="preserve">
<value> 2.直连的Domain或IP </value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="groupBox3.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtDirectIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
</data>
<data name="groupBox4.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="txtDirectDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="tabPageBlock.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageBlock.Text" xml:space="preserve">
<value> 3.阻止的Domain或IP </value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtBlockIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="txtBlockDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="tabPageRuleList.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageRuleList.Text" xml:space="preserve">
<value> 预定义规则集列表</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>803, 437</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>817, 605</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>路由设置</value>
</data>
</root>

View file

@ -0,0 +1,106 @@
namespace v2rayN.Forms
{
partial class RoutingSubSettingForm
{
/// <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(RoutingSubSettingForm));
this.panel2 = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.panCon = new System.Windows.Forms.Panel();
this.txtUrl = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.panel2.SuspendLayout();
this.panCon.SuspendLayout();
this.SuspendLayout();
//
// panel2
//
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
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);
//
// panCon
//
resources.ApplyResources(this.panCon, "panCon");
this.panCon.Controls.Add(this.txtUrl);
this.panCon.Controls.Add(this.label3);
this.panCon.Name = "panCon";
//
// txtUrl
//
resources.ApplyResources(this.txtUrl, "txtUrl");
this.txtUrl.Name = "txtUrl";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// RoutingSubSettingForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.panCon);
this.Controls.Add(this.panel2);
this.Name = "RoutingSubSettingForm";
this.Load += new System.EventHandler(this.RoutingSubSettingForm_Load);
this.panel2.ResumeLayout(false);
this.panCon.ResumeLayout(false);
this.panCon.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panCon;
private System.Windows.Forms.TextBox txtUrl;
private System.Windows.Forms.Label label3;
}
}

View file

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingSubSettingForm : BaseForm
{
public string Url;
public RoutingSubSettingForm()
{
InitializeComponent();
}
private void RoutingSubSettingForm_Load(object sender, EventArgs e)
{
if (config.ruleSubItem == null)
{
config.ruleSubItem = new List<SubItem>();
}
if (config.ruleSubItem.Count <= 0)
{
config.ruleSubItem.Add(new SubItem
{
remarks = "def",
url = Global.CustomRoutingListUrl + "custom_routing_rules"
});
}
txtUrl.Text = config.ruleSubItem[0].url;
}
private void btnOK_Click(object sender, EventArgs e)
{
var url = txtUrl.Text.Trim();
if (Utils.IsNullOrEmpty(url))
{
return;
}
Url = url;
config.ruleSubItem[0].url = url;
ConfigHandler.SaveRuleSubItem(ref config);
this.DialogResult = DialogResult.OK;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -0,0 +1,300 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>448, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>355, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 166</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>545, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panCon.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>83, 19</value>
</data>
<data name="txtUrl.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>450, 113</value>
</data>
<data name="txtUrl.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;txtUrl.Name" xml:space="preserve">
<value>txtUrl</value>
</data>
<data name="&gt;&gt;txtUrl.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;txtUrl.Parent" xml:space="preserve">
<value>panCon</value>
</data>
<data name="&gt;&gt;txtUrl.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 19</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 12</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Url</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</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="&gt;&gt;label3.Parent" xml:space="preserve">
<value>panCon</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</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, 0</value>
</data>
<data name="panCon.Size" type="System.Drawing.Size, System.Drawing">
<value>545, 166</value>
</data>
<data name="panCon.TabIndex" type="System.Int32, mscorlib">
<value>11</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>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>545, 226</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>RoutingSubSetting</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingSubSettingForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>地址 (url)</value>
</data>
</root>

View file

@ -29,27 +29,38 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SubSettingControl));
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.grbMain = new System.Windows.Forms.GroupBox();
this.btnShare = new System.Windows.Forms.Button();
this.chkEnabled = new System.Windows.Forms.CheckBox();
this.btnRemove = new System.Windows.Forms.Button();
this.txtUrl = 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.picQRCode = new System.Windows.Forms.PictureBox();
this.grbMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picQRCode)).BeginInit();
this.SuspendLayout();
//
// groupBox2
// grbMain
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.chkEnabled);
this.groupBox2.Controls.Add(this.btnRemove);
this.groupBox2.Controls.Add(this.txtUrl);
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;
resources.ApplyResources(this.grbMain, "grbMain");
this.grbMain.Controls.Add(this.btnShare);
this.grbMain.Controls.Add(this.chkEnabled);
this.grbMain.Controls.Add(this.btnRemove);
this.grbMain.Controls.Add(this.txtUrl);
this.grbMain.Controls.Add(this.txtRemarks);
this.grbMain.Controls.Add(this.label2);
this.grbMain.Controls.Add(this.label3);
this.grbMain.Name = "grbMain";
this.grbMain.TabStop = false;
//
// btnShare
//
resources.ApplyResources(this.btnShare, "btnShare");
this.btnShare.Name = "btnShare";
this.btnShare.UseVisualStyleBackColor = true;
this.btnShare.Click += new System.EventHandler(this.btnShare_Click);
//
// chkEnabled
//
@ -87,27 +98,37 @@
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// picQRCode
//
resources.ApplyResources(this.picQRCode, "picQRCode");
this.picQRCode.Name = "picQRCode";
this.picQRCode.TabStop = false;
//
// SubSettingControl
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.picQRCode);
this.Controls.Add(this.grbMain);
this.Name = "SubSettingControl";
this.Load += new System.EventHandler(this.SubSettingControl_Load);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.grbMain.ResumeLayout(false);
this.grbMain.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picQRCode)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox grbMain;
private System.Windows.Forms.TextBox txtUrl;
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.CheckBox chkEnabled;
private System.Windows.Forms.Button btnShare;
private System.Windows.Forms.PictureBox picQRCode;
}
}

View file

@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
@ -11,7 +12,10 @@ namespace v2rayN.Forms
public event ChangeEventHandler OnButtonClicked;
public SubItem subItem { get; set; }
public SubItem subItem
{
get; set;
}
public SubSettingControl()
{
@ -20,6 +24,7 @@ namespace v2rayN.Forms
private void SubSettingControl_Load(object sender, EventArgs e)
{
this.Height = grbMain.Height;
BindingSub();
}
@ -56,5 +61,23 @@ namespace v2rayN.Forms
OnButtonClicked?.Invoke(sender, e);
}
private void btnShare_Click(object sender, EventArgs e)
{
if (this.Height <= grbMain.Height)
{
if (Utils.IsNullOrEmpty(subItem.url))
{
picQRCode.Image = null;
return;
}
picQRCode.Image = QRCodeHelper.GetQRCode(subItem.url);
this.Height = grbMain.Height + 200;
}
else
{
this.Height = grbMain.Height;
}
}
}
}

View file

@ -118,123 +118,267 @@
<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" />
<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" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib">
<value>zh-Hans</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>584, 119</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>484, 21</value>
</data>
<data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnRemove.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="btnRemove.Text" xml:space="preserve">
<value>&amp;Remove</value>
</data>
<data name="chkEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="chkEnabled.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="chkEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>406, 23</value>
</data>
<data name="chkEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 16</value>
</data>
<data name="chkEnabled.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="chkEnabled.Text" xml:space="preserve">
<value>Enable</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 9</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>584, 110</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>Subscription details</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 25</value>
<data name="&gt;&gt;txtUrl.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="chkEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 16</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="&gt;&gt;txtUrl.Name" xml:space="preserve">
<value>txtUrl</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
<data name="&gt;&gt;picQRCode.Name" xml:space="preserve">
<value>picQRCode</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
<data name="&gt;&gt;btnShare.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="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
<data name="btnRemove.Text" xml:space="preserve">
<value>Remove</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 55</value>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
<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="label3.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
<data name="&gt;&gt;grbMain.Name" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Address (url)</value>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>SubSettingControl</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 21</value>
<data name="picQRCode.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
<value>Zoom</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>265, 21</value>
<data name="grbMain.Text" xml:space="preserve">
<value>Subscription details</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
<data name="btnShare.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 55</value>
<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="txtUrl.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>432, 46</value>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="btnShare.Location" type="System.Drawing.Point, System.Drawing">
<value>434, 21</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="&gt;&gt;picQRCode.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 21</value>
</data>
<data name="grbMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</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="btnShare.Text" xml:space="preserve">
<value>Share</value>
</data>
<data name="picQRCode.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 200</value>
</data>
<data name="&gt;&gt;chkEnabled.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 55</value>
</data>
<data name="btnShare.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="picQRCode.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;grbMain.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="picQRCode.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 55</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="&gt;&gt;txtUrl.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;chkEnabled.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;grbMain.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="&gt;&gt;btnRemove.Name" xml:space="preserve">
<value>btnRemove</value>
</data>
<data name="&gt;&gt;txtUrl.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="chkEnabled.Text" xml:space="preserve">
<value>Enable</value>
</data>
<data name="&gt;&gt;chkEnabled.Name" xml:space="preserve">
<value>chkEnabled</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 310</value>
</data>
<data name="btnShare.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;btnRemove.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;btnShare.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="chkEnabled.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="txtUrl.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="chkEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>368, 23</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="chkEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="grbMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;picQRCode.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;picQRCode.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label3.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;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="grbMain.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 110</value>
</data>
<data name="&gt;&gt;btnShare.Name" xml:space="preserve">
<value>btnShare</value>
</data>
<data name="&gt;&gt;btnShare.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="chkEnabled.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="picQRCode.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 110</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="picQRCode.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="txtUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>473, 46</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 25</value>
</data>
<data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;grbMain.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Address (url)</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>
<data name="grbMain.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>525, 21</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;chkEnabled.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&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>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View file

@ -117,18 +117,18 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnRemove.Text" xml:space="preserve">
<value>移除</value>
<data name="btnShare.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="chkEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>48, 16</value>
</data>
<data name="chkEnabled.Text" xml:space="preserve">
<value>启用</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>订阅详情</value>
<data name="btnRemove.Text" xml:space="preserve">
<value>移除</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
@ -142,4 +142,7 @@
<data name="label3.Text" xml:space="preserve">
<value>地址 (url)</value>
</data>
<data name="grbMain.Text" xml:space="preserve">
<value>订阅详情</value>
</data>
</root>

View file

@ -118,19 +118,61 @@
<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="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>448, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>581, 629</value>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib">
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panCon.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Subscription settings</value>
<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, 0</value>
</data>
<data name="panCon.Size" type="System.Drawing.Size, System.Drawing">
<value>614, 569</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>
@ -147,20 +189,17 @@
<data name="btnAdd.Text" xml:space="preserve">
<value>&amp;Add</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
<data name="&gt;&gt;btnAdd.Name" xml:space="preserve">
<value>btnAdd</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>448, 17</value>
<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="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
<data name="&gt;&gt;btnAdd.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
<data name="&gt;&gt;btnAdd.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -177,20 +216,17 @@
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="panCon.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="panCon.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</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>
<data name="panCon.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="panCon.Size" type="System.Drawing.Size, System.Drawing">
<value>581, 569</value>
</data>
<data name="panCon.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
@ -199,9 +235,39 @@
<value>0, 569</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>581, 60</value>
<value>614, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>614, 629</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Subscription settings</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>SubSettingForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -1,4 +1,6 @@

using System.Collections.Generic;
namespace v2rayN
{
class Global
@ -9,12 +11,15 @@ 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>
/// SpeedTestUrl
/// </summary>
public const string SpeedTestUrl = @"http://speedtest-sgp1.digitalocean.com/10mb.test";
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";
@ -23,7 +28,6 @@ namespace v2rayN
/// </summary>
public const string CustomRoutingListUrl = @"https://raw.githubusercontent.com/2dust/v2rayCustomRoutingList/master/";
public const string GFWLIST_URL = "https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt";
/// <summary>
/// PromotionUrl
@ -56,10 +60,7 @@ namespace v2rayN
/// v2ray配置Httpresponse文件名
/// </summary>
public const string v2raySampleHttpresponseFileName = "v2rayN.Sample.SampleHttpresponse.txt";
/// <summary>
/// 空白的pac文件
/// </summary>
public const string BlankPacFileName = "v2rayN.Sample.BlankPac.txt";
public const string CustomRoutingFileName = "v2rayN.Sample.custom_routing_";
@ -103,6 +104,7 @@ namespace v2rayN
///
/// </summary>
public const string StreamSecurity = "tls";
public const string StreamSecurityX = "xtls";
public const string InboundSocks = "socks";
public const string InboundHttp = "http";
@ -116,14 +118,26 @@ namespace v2rayN
/// </summary>
public const string vmessProtocol = "vmess://";
/// <summary>
/// vmess
/// </summary>
public const string vmessProtocolLite = "vmess";
/// <summary>
/// shadowsocks
/// </summary>
public const string ssProtocol = "ss://";
/// <summary>
/// shadowsocks
/// </summary>
public const string ssProtocolLite = "shadowsocks";
/// <summary>
/// socks
/// </summary>
public const string socksProtocol = "socks://";
/// <summary>
/// socks
/// </summary>
public const string socksProtocolLite = "socks";
/// <summary>
/// http
/// </summary>
public const string httpProtocol = "http://";
@ -131,11 +145,22 @@ namespace v2rayN
/// https
/// </summary>
public const string httpsProtocol = "https://";
/// <summary>
/// pac
/// vless
/// </summary>
public const string pacFILE = "pac.txt";
public const string vlessProtocol = "vless://";
/// <summary>
/// vless
/// </summary>
public const string vlessProtocolLite = "vless";
/// <summary>
/// trojan
/// </summary>
public const string trojanProtocol = "trojan://";
/// <summary>
/// trojan
/// </summary>
public const string trojanProtocolLite = "trojan";
/// <summary>
/// email
@ -166,6 +191,9 @@ namespace v2rayN
public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*";
public const string RoutingRuleComma = "<COMMA>";
public static readonly IEnumerable<string> ssSecuritys = new HashSet<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
#endregion
#region
@ -202,13 +230,6 @@ namespace v2rayN
get; set;
}
/// <summary>
/// PAC端口
/// </summary>
public static int pacPort
{
get; set;
}
/// <summary>
///

View file

@ -16,6 +16,8 @@ namespace v2rayN.Handler
{
private static string configRes = Global.ConfigFileName;
#region ConfigHandler
/// <summary>
/// 载入配置文件
/// </summary>
@ -40,7 +42,7 @@ namespace v2rayN.Handler
vmess = new List<VmessItem>(),
//Mux
muxEnabled = true,
muxEnabled = false,
////默认监听端口
//config.pacPort = 8888;
@ -87,22 +89,7 @@ namespace v2rayN.Handler
{
config.domainStrategy = "IPIfNonMatch";
}
if (Utils.IsNullOrEmpty(config.routingMode))
{
config.routingMode = "0";
}
if (config.useragent == null)
{
config.useragent = new List<string>();
}
if (config.userdirect == null)
{
config.userdirect = new List<string>();
}
if (config.userblock == null)
{
config.userblock = new List<string>();
}
//kcp
if (config.kcpItem == null)
{
@ -139,10 +126,6 @@ namespace v2rayN.Handler
{
config.speedPingTestUrl = Global.SpeedPingTestUrl;
}
if (Utils.IsNullOrEmpty(config.urlGFWList))
{
config.urlGFWList = Global.GFWLIST_URL;
}
//if (Utils.IsNullOrEmpty(config.remoteDNS))
//{
// config.remoteDNS = "1.1.1.1";
@ -152,10 +135,6 @@ namespace v2rayN.Handler
{
config.subItem = new List<SubItem>();
}
if (config.userPacRule == null)
{
config.userPacRule = new List<string>();
}
if (config == null
|| config.index < 0
@ -180,6 +159,10 @@ namespace v2rayN.Handler
return 0;
}
#endregion
#region Server
/// <summary>
/// 添加服务器或编辑
/// </summary>
@ -299,7 +282,8 @@ namespace v2rayN.Handler
path = config.vmess[index].path,
streamSecurity = config.vmess[index].streamSecurity,
allowInsecure = config.vmess[index].allowInsecure,
configType = config.vmess[index].configType
configType = config.vmess[index].configType,
flow = config.vmess[index].flow
};
config.vmess.Insert(index + 1, vmessItem); // 插入到下一项
@ -358,82 +342,6 @@ namespace v2rayN.Handler
Utils.ToJsonFile(config, Utils.GetPath(configRes));
}
/// <summary>
/// 取得服务器QRCode配置
/// </summary>
/// <param name="config"></param>
/// <param name="index"></param>
/// <returns></returns>
public static string GetVmessQRCode(Config config, int index)
{
try
{
string url = string.Empty;
VmessItem vmessItem = config.vmess[index];
if (vmessItem.configType == (int)EConfigType.Vmess)
{
VmessQRCode vmessQRCode = new VmessQRCode
{
v = vmessItem.configVersion.ToString(),
ps = vmessItem.remarks.TrimEx(), //备注也许很长 ;
add = vmessItem.address,
port = vmessItem.port.ToString(),
id = vmessItem.id,
aid = vmessItem.alterId.ToString(),
net = vmessItem.network,
type = vmessItem.headerType,
host = vmessItem.requestHost,
path = vmessItem.path,
tls = vmessItem.streamSecurity
};
url = Utils.ToJson(vmessQRCode);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}", Global.vmessProtocol, url);
}
else if (vmessItem.configType == (int)EConfigType.Shadowsocks)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(vmessItem.remarks))
{
remark = "#" + WebUtility.UrlEncode(vmessItem.remarks);
}
url = string.Format("{0}:{1}@{2}:{3}",
vmessItem.security,
vmessItem.id,
vmessItem.address,
vmessItem.port);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}{2}", Global.ssProtocol, url, remark);
}
else if (vmessItem.configType == (int)EConfigType.Socks)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(vmessItem.remarks))
{
remark = "#" + WebUtility.UrlEncode(vmessItem.remarks);
}
url = string.Format("{0}:{1}@{2}:{3}",
vmessItem.security,
vmessItem.id,
vmessItem.address,
vmessItem.port);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}{2}", Global.socksProtocol, url, remark);
}
else
{
}
return url;
}
catch
{
return "";
}
}
/// <summary>
/// 移动服务器
/// </summary>
@ -620,6 +528,11 @@ namespace v2rayN.Handler
vmessItem.id = vmessItem.id.TrimEx();
vmessItem.security = vmessItem.security.TrimEx();
if (!Global.ssSecuritys.Contains(vmessItem.security))
{
return -1;
}
if (index >= 0)
{
//修改
@ -684,6 +597,53 @@ namespace v2rayN.Handler
return 0;
}
/// <summary>
/// 添加服务器或编辑
/// </summary>
/// <param name="config"></param>
/// <param name="vmessItem"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int AddTrojanServer(ref Config config, VmessItem vmessItem, int index)
{
vmessItem.configVersion = 2;
vmessItem.configType = (int)EConfigType.Trojan;
vmessItem.address = vmessItem.address.TrimEx();
vmessItem.id = vmessItem.id.TrimEx();
vmessItem.streamSecurity = Global.StreamSecurity;
if (Utils.IsNullOrEmpty(vmessItem.allowInsecure))
{
vmessItem.allowInsecure = config.defAllowInsecure.ToString();
}
if (index >= 0)
{
//修改
config.vmess[index] = vmessItem;
if (config.index.Equals(index))
{
Global.reloadV2ray = true;
}
}
else
{
//添加
config.vmess.Add(vmessItem);
if (config.vmess.Count == 1)
{
config.index = 0;
Global.reloadV2ray = true;
}
}
ToJsonFile(config);
return 0;
}
/// <summary>
/// 配置文件版本升级
/// </summary>
@ -781,7 +741,7 @@ namespace v2rayN.Handler
}
continue;
}
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(str, out string msg);
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(str, out string msg);
if (vmessItem == null)
{
continue;
@ -808,6 +768,20 @@ namespace v2rayN.Handler
countServers++;
}
}
else if (vmessItem.configType == (int)EConfigType.Trojan)
{
if (AddTrojanServer(ref config, vmessItem, -1) == 0)
{
countServers++;
}
}
else if (vmessItem.configType == (int)EConfigType.VLESS)
{
if (AddVlessServer(ref config, vmessItem, -1) == 0)
{
countServers++;
}
}
}
return countServers;
}
@ -888,38 +862,6 @@ namespace v2rayN.Handler
return 0;
}
public static int AddformMainLvColWidth(ref Config config, string name, int width)
{
if (config.uiItem.mainLvColWidth == null)
{
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
}
if (config.uiItem.mainLvColWidth.ContainsKey(name))
{
config.uiItem.mainLvColWidth[name] = width;
}
else
{
config.uiItem.mainLvColWidth.Add(name, width);
}
return 0;
}
public static int GetformMainLvColWidth(ref Config config, string name, int width)
{
if (config.uiItem.mainLvColWidth == null)
{
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
}
if (config.uiItem.mainLvColWidth.ContainsKey(name))
{
return config.uiItem.mainLvColWidth[name];
}
else
{
return width;
}
}
public static int SortServers(ref Config config, EServerColName name, bool asc)
{
if (config.vmess.Count <= 0)
@ -960,5 +902,303 @@ namespace v2rayN.Handler
ToJsonFile(config);
return 0;
}
/// <summary>
/// 添加服务器或编辑
/// </summary>
/// <param name="config"></param>
/// <param name="vmessItem"></param>
/// <param name="index"></param>
/// <returns></returns>
public static int AddVlessServer(ref Config config, VmessItem vmessItem, int index)
{
vmessItem.configVersion = 2;
vmessItem.configType = (int)EConfigType.VLESS;
vmessItem.address = vmessItem.address.TrimEx();
vmessItem.id = vmessItem.id.TrimEx();
vmessItem.security = vmessItem.security.TrimEx();
vmessItem.network = vmessItem.network.TrimEx();
vmessItem.headerType = vmessItem.headerType.TrimEx();
vmessItem.requestHost = vmessItem.requestHost.TrimEx();
vmessItem.path = vmessItem.path.TrimEx();
vmessItem.streamSecurity = vmessItem.streamSecurity.TrimEx();
if (index >= 0)
{
//修改
config.vmess[index] = vmessItem;
if (config.index.Equals(index))
{
Global.reloadV2ray = true;
}
}
else
{
//添加
if (Utils.IsNullOrEmpty(vmessItem.allowInsecure))
{
vmessItem.allowInsecure = config.defAllowInsecure.ToString();
}
config.vmess.Add(vmessItem);
if (config.vmess.Count == 1)
{
config.index = 0;
Global.reloadV2ray = true;
}
}
ToJsonFile(config);
return 0;
}
#endregion
#region UI
public static int AddformMainLvColWidth(ref Config config, string name, int width)
{
if (config.uiItem.mainLvColWidth == null)
{
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
}
if (config.uiItem.mainLvColWidth.ContainsKey(name))
{
config.uiItem.mainLvColWidth[name] = width;
}
else
{
config.uiItem.mainLvColWidth.Add(name, width);
}
return 0;
}
public static int GetformMainLvColWidth(ref Config config, string name, int width)
{
if (config.uiItem.mainLvColWidth == null)
{
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
}
if (config.uiItem.mainLvColWidth.ContainsKey(name))
{
return config.uiItem.mainLvColWidth[name];
}
else
{
return width;
}
}
#endregion
#region Routing
public static int SaveRouting(ref Config config)
{
if (config.routings == null)
{
return -1;
}
foreach (var item in config.routings)
{
}
//move locked item
int index = config.routings.FindIndex(it => it.locked == true);
if (index != -1)
{
var item = Utils.DeepCopy(config.routings[index]);
config.routings.RemoveAt(index);
config.routings.Add(item);
}
if (config.routingIndex >= config.routings.Count)
{
config.routingIndex = 0;
}
Global.reloadV2ray = true;
ToJsonFile(config);
return 0;
}
public static int AddRoutingItem(ref Config config, RoutingItem item, int index)
{
if (index >= 0)
{
config.routings[index] = item;
}
else
{
config.routings.Add(item);
}
ToJsonFile(config);
return 0;
}
/// <summary>
/// AddBatchRoutingRules
/// </summary>
/// <param name="config"></param>
/// <param name="clipboardData"></param>
/// <returns></returns>
public static int AddBatchRoutingRules(ref RoutingItem routingItem, string clipboardData)
{
if (Utils.IsNullOrEmpty(clipboardData))
{
return -1;
}
var lstRules = Utils.FromJson<List<RulesItem>>(clipboardData);
if (lstRules == null)
{
return -1;
}
routingItem.rules.Clear();
foreach (var item in lstRules)
{
routingItem.rules.Add(item);
}
return 0;
}
/// <summary>
/// MoveRoutingRule
/// </summary>
/// <param name="routingItem"></param>
/// <param name="index"></param>
/// <param name="eMove"></param>
/// <returns></returns>
public static int MoveRoutingRule(ref RoutingItem routingItem, int index, EMove eMove)
{
int count = routingItem.rules.Count;
if (index < 0 || index > routingItem.rules.Count - 1)
{
return -1;
}
switch (eMove)
{
case EMove.Top:
{
if (index == 0)
{
return 0;
}
var item = Utils.DeepCopy(routingItem.rules[index]);
routingItem.rules.RemoveAt(index);
routingItem.rules.Insert(0, item);
break;
}
case EMove.Up:
{
if (index == 0)
{
return 0;
}
var item = Utils.DeepCopy(routingItem.rules[index]);
routingItem.rules.RemoveAt(index);
routingItem.rules.Insert(index - 1, item);
break;
}
case EMove.Down:
{
if (index == count - 1)
{
return 0;
}
var item = Utils.DeepCopy(routingItem.rules[index]);
routingItem.rules.RemoveAt(index);
routingItem.rules.Insert(index + 1, item);
break;
}
case EMove.Bottom:
{
if (index == count - 1)
{
return 0;
}
var item = Utils.DeepCopy(routingItem.rules[index]);
routingItem.rules.RemoveAt(index);
routingItem.rules.Add(item);
break;
}
}
return 0;
}
public static int SetDefaultRouting(ref Config config, int index)
{
if (index < 0 || index > config.routings.Count - 1)
{
return -1;
}
////和现在相同
//if (config.index.Equals(index))
//{
// return -1;
//}
config.routingIndex = index;
Global.reloadV2ray = true;
ToJsonFile(config);
return 0;
}
public static int InitBuiltinRouting(ref Config config)
{
if (config.routings == null)
{
config.routings = new List<RoutingItem>();
}
if (config.routings.Count <= 0)
{
//Bypass the mainland
var item2 = new RoutingItem();
item2.remarks = "绕过大陆(Whitelist)";
item2.url = string.Empty;
item2.rules = new List<RulesItem>();
string result2 = Utils.GetEmbedText(Global.CustomRoutingFileName + "white");
AddBatchRoutingRules(ref item2, result2);
config.routings.Add(item2);
config.routingIndex = 0;
}
if (GetLockedRoutingItem(ref config) == null)
{
var item1 = new RoutingItem();
item1.remarks = "locked";
item1.url = string.Empty;
item1.rules = new List<RulesItem>();
item1.locked = true;
string result1 = Utils.GetEmbedText(Global.CustomRoutingFileName + "locked");
AddBatchRoutingRules(ref item1, result1);
config.routings.Add(item1);
}
SaveRouting(ref config);
return 0;
}
public static RoutingItem GetLockedRoutingItem(ref Config config)
{
if (config.routings == null)
{
return null;
}
return config.routings.Find(it => it.locked == true);
}
#endregion
}
}

View file

@ -52,10 +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 coreLatestUrl = "https://github.com/v2fly/v2ray-core/releases/latest";
private const string coreUrl = "https://github.com/v2fly/v2ray-core/releases/download/{0}/v2ray-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)
{
@ -67,9 +69,13 @@ namespace v2rayN.Handler
HttpClient httpClient = new HttpClient(webRequestHandler);
string url;
if (type == "Core")
if (type == "v2fly")
{
url = coreLatestUrl;
url = v2flyCoreLatestUrl;
}
else if (type == "xray")
{
url = xrayCoreLatestUrl;
}
else if (type == "v2rayN")
{
@ -94,14 +100,26 @@ namespace v2rayN.Handler
/// <summary>
/// 获取V2RayCore版本
/// </summary>
public string getV2rayVersion()
public string getCoreVersion(string type)
{
try
{
string filePath = Utils.GetPath("V2ray.exe");
var core = string.Empty;
var match = string.Empty;
if (type == "v2fly")
{
core = "v2ray.exe";
match = "V2Ray";
}
else if (type == "xray")
{
core = "xray.exe";
match = "Xray";
}
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 "";
}
@ -117,10 +135,9 @@ namespace v2rayN.Handler
p.Start();
p.WaitForExit(5000);
string echo = p.StandardOutput.ReadToEnd();
string version = Regex.Match(echo, "V2Ray ([0-9.]+) \\(").Groups[1].Value;
string version = Regex.Match(echo, $"{match} ([0-9.]+) \\(").Groups[1].Value;
return version;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
@ -136,12 +153,19 @@ namespace v2rayN.Handler
string curVersion;
string message;
string url;
if (type == "Core")
if (type == "v2fly")
{
curVersion = "v" + getV2rayVersion();
curVersion = "v" + getCoreVersion(type);
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion);
string osBit = Environment.Is64BitProcess ? "64" : "32";
url = string.Format(coreUrl, version, osBit);
url = string.Format(v2flyCoreUrl, version, osBit);
}
else if (type == "xray")
{
curVersion = "v" + getCoreVersion(type);
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion);
string osBit = Environment.Is64BitProcess ? "64" : "32";
url = string.Format(xrayCoreUrl, version, osBit);
}
else if (type == "v2rayN")
{
@ -242,8 +266,8 @@ namespace v2rayN.Handler
{
((WebClientEx)sender).Dispose();
TimeSpan ts = (DateTime.Now - totalDatetime);
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.##"));
UpdateCompleted(this, new ResultEventArgs(true, speed));
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.0"));
UpdateCompleted(this, new ResultEventArgs(true, speed.PadLeft(8, ' ')));
return;
}
@ -252,8 +276,8 @@ namespace v2rayN.Handler
{
TimeSpan ts = (DateTime.Now - totalDatetime);
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.##"));
UpdateCompleted(this, new ResultEventArgs(true, speed));
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.0"));
UpdateCompleted(this, new ResultEventArgs(true, speed.PadLeft(8, ' ')));
}
else
{
@ -313,47 +337,24 @@ namespace v2rayN.Handler
}
}
#endregion
#region PAC
public string GenPacFile(string result)
public string WebDownloadStringSync(string url)
{
string source = string.Empty;
try
{
File.WriteAllText(Utils.GetTempPath("gfwlist.txt"), result, Encoding.UTF8);
List<string> lines = ParsePacResult(result);
string abpContent = Utils.UnGzip(Resources.abp_js);
abpContent = abpContent.Replace("__RULES__", JsonConvert.SerializeObject(lines, Formatting.Indented));
File.WriteAllText(Utils.GetPath(Global.pacFILE), abpContent, Encoding.UTF8);
Utils.SetSecurityProtocol();
WebClientEx ws = new WebClientEx();
return ws.DownloadString(new Uri(url));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return ex.Message;
return string.Empty;
}
return string.Empty;
}
private List<string> ParsePacResult(string response)
{
IEnumerable<char> IgnoredLineBegins = new[] { '!', '[' };
byte[] bytes = Convert.FromBase64String(response);
string content = Encoding.UTF8.GetString(bytes);
List<string> valid_lines = new List<string>();
using (StringReader sr = new StringReader(content))
{
foreach (string line in sr.NonWhiteSpaceLines())
{
if (line.BeginWithAny(IgnoredLineBegins))
continue;
valid_lines.Add(line);
}
}
return valid_lines;
}
#endregion
}
}

View file

@ -1,6 +1,7 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
@ -8,6 +9,7 @@ namespace v2rayN.Handler
class MainFormHandler
{
private static MainFormHandler instance;
Action<bool, string> updateUI;
//private DownloadHandle downloadHandle2;
//private Config _config;
@ -32,7 +34,7 @@ namespace v2rayN.Handler
try
{
Color color = ColorTranslator.FromHtml("#3399CC");
int index = (int)config.listenerType;
int index = (int)config.sysProxyType;
if (index > 0)
{
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange, Color.DarkSlateBlue, Color.RoyalBlue })[index - 1];
@ -72,7 +74,8 @@ namespace v2rayN.Handler
{
return;
}
if (config.vmess[index].configType != (int)EConfigType.Vmess)
if (config.vmess[index].configType != (int)EConfigType.Vmess
&& config.vmess[index].configType != (int)EConfigType.VLESS)
{
UI.Show(UIRes.I18N("NonVmessService"));
return;
@ -112,7 +115,8 @@ namespace v2rayN.Handler
{
return;
}
if (config.vmess[index].configType != (int)EConfigType.Vmess)
if (config.vmess[index].configType != (int)EConfigType.Vmess
&& config.vmess[index].configType != (int)EConfigType.VLESS)
{
UI.Show(UIRes.I18N("NonVmessService"));
return;
@ -145,6 +149,93 @@ namespace v2rayN.Handler
}
}
public int AddBatchServers(Config config, string clipboardData, string subid = "")
{
int counter;
int _Add()
{
return ConfigHandler.AddBatchServers(ref config, clipboardData, subid);
}
counter = _Add();
if (counter < 1)
{
clipboardData = Utils.Base64Decode(clipboardData);
counter = _Add();
}
return counter;
}
public void UpdateSubscriptionProcess(Config config, Action<bool, string> update)
{
updateUI = update;
updateUI(false, UIRes.I18N("MsgUpdateSubscriptionStart"));
if (config.subItem == null || config.subItem.Count <= 0)
{
updateUI(false, UIRes.I18N("MsgNoValidSubscription"));
return;
}
for (int k = 1; k <= config.subItem.Count; k++)
{
string id = config.subItem[k - 1].id.TrimEx();
string url = config.subItem[k - 1].url.TrimEx();
string hashCode = $"{k}->";
if (config.subItem[k - 1].enabled == false)
{
continue;
}
if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url))
{
updateUI(false, $"{hashCode}{UIRes.I18N("MsgNoValidSubscription")}");
continue;
}
DownloadHandle downloadHandle3 = new DownloadHandle();
downloadHandle3.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
updateUI(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}");
string result = Utils.Base64Decode(args.Msg);
if (Utils.IsNullOrEmpty(result))
{
updateUI(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}");
return;
}
ConfigHandler.RemoveServerViaSubid(ref config, id);
updateUI(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}");
// RefreshServers();
int ret = MainFormHandler.Instance.AddBatchServers(config, result, id);
if (ret > 0)
{
// RefreshServers();
}
else
{
updateUI(false, $"{hashCode}{UIRes.I18N("MsgFailedImportSubscription")}");
}
updateUI(true, $"{hashCode}{UIRes.I18N("MsgUpdateSubscriptionEnd")}");
}
else
{
updateUI(false, args.Msg);
}
};
downloadHandle3.Error += (sender2, args) =>
{
updateUI(false, args.GetException().Message);
};
downloadHandle3.WebDownloadString(url);
updateUI(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
}
}
}
}

View file

@ -0,0 +1,690 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
{
class ShareHandler
{
#region GetShareUrl
/// <summary>
/// GetShareUrl
/// </summary>
/// <param name="config"></param>
/// <param name="index"></param>
/// <returns></returns>
public static string GetShareUrl(Config config, int index)
{
try
{
string url = string.Empty;
VmessItem item = config.vmess[index];
if (item.configType == (int)EConfigType.Vmess)
{
VmessQRCode vmessQRCode = new VmessQRCode
{
v = item.configVersion.ToString(),
ps = item.remarks.TrimEx(), //备注也许很长 ;
add = item.address,
port = item.port.ToString(),
id = item.id,
aid = item.alterId.ToString(),
net = item.network,
type = item.headerType,
host = item.requestHost,
path = item.path,
tls = item.streamSecurity,
sni = item.sni
};
url = Utils.ToJson(vmessQRCode);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}", Global.vmessProtocol, url);
}
else if (item.configType == (int)EConfigType.Shadowsocks)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(item.remarks))
{
remark = "#" + Utils.UrlEncode(item.remarks);
}
url = string.Format("{0}:{1}@{2}:{3}",
item.security,
item.id,
item.address,
item.port);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}{2}", Global.ssProtocol, url, remark);
}
else if (item.configType == (int)EConfigType.Socks)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(item.remarks))
{
remark = "#" + Utils.UrlEncode(item.remarks);
}
url = string.Format("{0}:{1}@{2}:{3}",
item.security,
item.id,
item.address,
item.port);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}{2}", Global.socksProtocol, url, remark);
}
else if (item.configType == (int)EConfigType.Trojan)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(item.remarks))
{
remark = "#" + Utils.UrlEncode(item.remarks);
}
string query = string.Empty;
if (!Utils.IsNullOrEmpty(item.sni))
{
query = string.Format("?sni={0}", Utils.UrlEncode(item.sni));
}
url = string.Format("{0}@{1}:{2}",
item.id,
item.address,
item.port);
url = string.Format("{0}{1}{2}{3}", Global.trojanProtocol, url, query, remark);
}
else if (item.configType == (int)EConfigType.VLESS)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(item.remarks))
{
remark = "#" + Utils.UrlEncode(item.remarks);
}
var dicQuery = new Dictionary<string, string>();
if (!Utils.IsNullOrEmpty(item.flow))
{
dicQuery.Add("flow", item.flow);
}
if (!Utils.IsNullOrEmpty(item.security))
{
dicQuery.Add("encryption", item.security);
}
else
{
dicQuery.Add("encryption", "none");
}
if (!Utils.IsNullOrEmpty(item.streamSecurity))
{
dicQuery.Add("security", item.streamSecurity);
}
else
{
dicQuery.Add("security", "none");
}
if (!Utils.IsNullOrEmpty(item.sni))
{
dicQuery.Add("sni", item.sni);
}
if (!Utils.IsNullOrEmpty(item.network))
{
dicQuery.Add("type", item.network);
}
else
{
dicQuery.Add("type", "tcp");
}
switch (item.network)
{
case "tcp":
if (!Utils.IsNullOrEmpty(item.headerType))
{
dicQuery.Add("headerType", item.headerType);
}
else
{
dicQuery.Add("headerType", "none");
}
if (!Utils.IsNullOrEmpty(item.requestHost))
{
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
}
break;
case "kcp":
if (!Utils.IsNullOrEmpty(item.headerType))
{
dicQuery.Add("headerType", item.headerType);
}
else
{
dicQuery.Add("headerType", "none");
}
if (!Utils.IsNullOrEmpty(item.path))
{
dicQuery.Add("seed", Utils.UrlEncode(item.path));
}
break;
case "ws":
if (!Utils.IsNullOrEmpty(item.requestHost))
{
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
}
if (!Utils.IsNullOrEmpty(item.path))
{
dicQuery.Add("path", Utils.UrlEncode(item.path));
}
break;
case "http":
case "h2":
dicQuery["type"] = "http";
if (!Utils.IsNullOrEmpty(item.requestHost))
{
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
}
if (!Utils.IsNullOrEmpty(item.path))
{
dicQuery.Add("path", Utils.UrlEncode(item.path));
}
break;
case "quic":
if (!Utils.IsNullOrEmpty(item.headerType))
{
dicQuery.Add("headerType", item.headerType);
}
else
{
dicQuery.Add("headerType", "none");
}
dicQuery.Add("quicSecurity", Utils.UrlEncode(item.requestHost));
dicQuery.Add("key", Utils.UrlEncode(item.path));
break;
}
string query = "?" + string.Join("&", dicQuery.Select(x => x.Key + "=" + x.Value).ToArray());
url = string.Format("{0}@{1}:{2}",
item.id,
item.address,
item.port);
url = string.Format("{0}{1}{2}{3}", Global.vlessProtocol, url, query, remark);
}
else
{
}
return url;
}
catch
{
return "";
}
}
#endregion
#region ImportShareUrl
/// <summary>
/// 从剪贴板导入URL
/// </summary>
/// <param name="fileName"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static VmessItem ImportFromClipboardConfig(string clipboardData, out string msg)
{
msg = string.Empty;
VmessItem vmessItem = new VmessItem();
try
{
//载入配置文件
string result = clipboardData.TrimEx();// Utils.GetClipboardData();
if (Utils.IsNullOrEmpty(result))
{
msg = UIRes.I18N("FailedReadConfiguration");
return null;
}
if (result.StartsWith(Global.vmessProtocol))
{
int indexSplit = result.IndexOf("?");
if (indexSplit > 0)
{
vmessItem = ResolveStdVmess(result) ?? ResolveVmess4Kitsunebi(result);
}
else
{
vmessItem.configType = (int)EConfigType.Vmess;
result = result.Substring(Global.vmessProtocol.Length);
result = Utils.Base64Decode(result);
//转成Json
VmessQRCode vmessQRCode = Utils.FromJson<VmessQRCode>(result);
if (vmessQRCode == null)
{
msg = UIRes.I18N("FailedConversionConfiguration");
return null;
}
vmessItem.security = Global.DefaultSecurity;
vmessItem.network = Global.DefaultNetwork;
vmessItem.headerType = Global.None;
vmessItem.configVersion = Utils.ToInt(vmessQRCode.v);
vmessItem.remarks = Utils.ToString(vmessQRCode.ps);
vmessItem.address = Utils.ToString(vmessQRCode.add);
vmessItem.port = Utils.ToInt(vmessQRCode.port);
vmessItem.id = Utils.ToString(vmessQRCode.id);
vmessItem.alterId = Utils.ToInt(vmessQRCode.aid);
if (!Utils.IsNullOrEmpty(vmessQRCode.net))
{
vmessItem.network = vmessQRCode.net;
}
if (!Utils.IsNullOrEmpty(vmessQRCode.type))
{
vmessItem.headerType = vmessQRCode.type;
}
vmessItem.requestHost = Utils.ToString(vmessQRCode.host);
vmessItem.path = Utils.ToString(vmessQRCode.path);
vmessItem.streamSecurity = Utils.ToString(vmessQRCode.tls);
vmessItem.sni = Utils.ToString(vmessQRCode.sni);
}
ConfigHandler.UpgradeServerVersion(ref vmessItem);
}
else if (result.StartsWith(Global.ssProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem = ResolveSSLegacy(result);
if (vmessItem == null)
{
vmessItem = ResolveSip002(result);
}
if (vmessItem == null)
{
return null;
}
if (vmessItem.address.Length == 0 || vmessItem.port == 0 || vmessItem.security.Length == 0 || vmessItem.id.Length == 0)
{
return null;
}
vmessItem.configType = (int)EConfigType.Shadowsocks;
}
else if (result.StartsWith(Global.socksProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem.configType = (int)EConfigType.Socks;
result = result.Substring(Global.socksProtocol.Length);
//remark
int indexRemark = result.IndexOf("#");
if (indexRemark > 0)
{
try
{
vmessItem.remarks = Utils.UrlDecode(result.Substring(indexRemark + 1, result.Length - indexRemark - 1));
}
catch { }
result = result.Substring(0, indexRemark);
}
//part decode
int indexS = result.IndexOf("@");
if (indexS > 0)
{
}
else
{
result = Utils.Base64Decode(result);
}
string[] arr1 = result.Split('@');
if (arr1.Length != 2)
{
return null;
}
string[] arr21 = arr1[0].Split(':');
//string[] arr22 = arr1[1].Split(':');
int indexPort = arr1[1].LastIndexOf(":");
if (arr21.Length != 2 || indexPort < 0)
{
return null;
}
vmessItem.address = arr1[1].Substring(0, indexPort);
vmessItem.port = Utils.ToInt(arr1[1].Substring(indexPort + 1, arr1[1].Length - (indexPort + 1)));
vmessItem.security = arr21[0];
vmessItem.id = arr21[1];
}
else if (result.StartsWith(Global.trojanProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem.configType = (int)EConfigType.Trojan;
Uri uri = new Uri(result);
vmessItem.address = uri.IdnHost;
vmessItem.port = uri.Port;
vmessItem.id = uri.UserInfo;
var qurery = HttpUtility.ParseQueryString(uri.Query);
vmessItem.sni = qurery["sni"] ?? "";
var remarks = uri.Fragment.Replace("#", "");
if (Utils.IsNullOrEmpty(remarks))
{
vmessItem.remarks = "NONE";
}
else
{
vmessItem.remarks = Utils.UrlDecode(remarks);
}
}
else if (result.StartsWith(Global.vlessProtocol))
{
vmessItem = ResolveStdVLESS(result);
ConfigHandler.UpgradeServerVersion(ref vmessItem);
}
else
{
msg = UIRes.I18N("NonvmessOrssProtocol");
return null;
}
}
catch
{
msg = UIRes.I18N("Incorrectconfiguration");
return null;
}
return vmessItem;
}
private static VmessItem ResolveVmess4Kitsunebi(string result)
{
VmessItem vmessItem = new VmessItem
{
configType = (int)EConfigType.Vmess
};
result = result.Substring(Global.vmessProtocol.Length);
int indexSplit = result.IndexOf("?");
if (indexSplit > 0)
{
result = result.Substring(0, indexSplit);
}
result = Utils.Base64Decode(result);
string[] arr1 = result.Split('@');
if (arr1.Length != 2)
{
return null;
}
string[] arr21 = arr1[0].Split(':');
string[] arr22 = arr1[1].Split(':');
if (arr21.Length != 2 || arr21.Length != 2)
{
return null;
}
vmessItem.address = arr22[0];
vmessItem.port = Utils.ToInt(arr22[1]);
vmessItem.security = arr21[0];
vmessItem.id = arr21[1];
vmessItem.network = Global.DefaultNetwork;
vmessItem.headerType = Global.None;
vmessItem.remarks = "Alien";
vmessItem.alterId = 0;
return vmessItem;
}
private static VmessItem ResolveSip002(string result)
{
Uri parsedUrl;
try
{
parsedUrl = new Uri(result);
}
catch (UriFormatException)
{
return null;
}
VmessItem server = new VmessItem
{
remarks = parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped),
address = parsedUrl.IdnHost,
port = parsedUrl.Port,
};
// parse base64 UserInfo
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.Unescaped);
string base64 = rawUserInfo.Replace('-', '+').Replace('_', '/'); // Web-safe base64 to normal base64
string userInfo;
try
{
userInfo = Encoding.UTF8.GetString(Convert.FromBase64String(
base64.PadRight(base64.Length + (4 - base64.Length % 4) % 4, '=')));
}
catch (FormatException)
{
return null;
}
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2);
if (userInfoParts.Length != 2)
{
return null;
}
server.security = userInfoParts[0];
server.id = userInfoParts[1];
NameValueCollection queryParameters = HttpUtility.ParseQueryString(parsedUrl.Query);
if (queryParameters["plugin"] != null)
{
return null;
}
return server;
}
private static readonly Regex UrlFinder = new Regex(@"ss://(?<base64>[A-Za-z0-9+-/=_]+)(?:#(?<tag>\S+))?", RegexOptions.IgnoreCase);
private static readonly Regex DetailsParser = new Regex(@"^((?<method>.+?):(?<password>.*)@(?<hostname>.+?):(?<port>\d+?))$", RegexOptions.IgnoreCase);
private static VmessItem ResolveSSLegacy(string result)
{
var match = UrlFinder.Match(result);
if (!match.Success)
return null;
VmessItem server = new VmessItem();
var base64 = match.Groups["base64"].Value.TrimEnd('/');
var tag = match.Groups["tag"].Value;
if (!Utils.IsNullOrEmpty(tag))
{
server.remarks = Utils.UrlDecode(tag);
}
Match details;
try
{
details = DetailsParser.Match(Encoding.UTF8.GetString(Convert.FromBase64String(
base64.PadRight(base64.Length + (4 - base64.Length % 4) % 4, '='))));
}
catch (FormatException)
{
return null;
}
if (!details.Success)
return null;
server.security = details.Groups["method"].Value;
server.id = details.Groups["password"].Value;
server.address = details.Groups["hostname"].Value;
server.port = int.Parse(details.Groups["port"].Value);
return server;
}
private static readonly Regex StdVmessUserInfo = new Regex(
@"^(?<network>[a-z]+)(\+(?<streamSecurity>[a-z]+))?:(?<id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})-(?<alterId>[0-9]+)$");
private static VmessItem ResolveStdVmess(string result)
{
VmessItem i = new VmessItem
{
configType = (int)EConfigType.Vmess,
security = "auto"
};
Uri u = new Uri(result);
i.address = u.IdnHost;
i.port = u.Port;
i.remarks = u.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
var q = HttpUtility.ParseQueryString(u.Query);
var m = StdVmessUserInfo.Match(u.UserInfo);
if (!m.Success) return null;
i.id = m.Groups["id"].Value;
if (!int.TryParse(m.Groups["alterId"].Value, out int aid))
{
return null;
}
i.alterId = aid;
if (m.Groups["streamSecurity"].Success)
{
i.streamSecurity = m.Groups["streamSecurity"].Value;
}
switch (i.streamSecurity)
{
case "tls":
// TODO tls config
break;
default:
if (!string.IsNullOrWhiteSpace(i.streamSecurity))
return null;
break;
}
i.network = m.Groups["network"].Value;
switch (i.network)
{
case "tcp":
string t1 = q["type"] ?? "none";
i.headerType = t1;
// TODO http option
break;
case "kcp":
i.headerType = q["type"] ?? "none";
// TODO kcp seed
break;
case "ws":
string p1 = q["path"] ?? "/";
string h1 = q["host"] ?? "";
i.requestHost = Utils.UrlDecode(h1);
i.path = p1;
break;
case "http":
case "h2":
i.network = "h2";
string p2 = q["path"] ?? "/";
string h2 = q["host"] ?? "";
i.requestHost = Utils.UrlDecode(h2);
i.path = p2;
break;
case "quic":
string s = q["security"] ?? "none";
string k = q["key"] ?? "";
string t3 = q["type"] ?? "none";
i.headerType = t3;
i.requestHost = Utils.UrlDecode(s);
i.path = k;
break;
default:
return null;
}
return i;
}
private static VmessItem ResolveStdVLESS(string result)
{
VmessItem item = new VmessItem
{
configType = (int)EConfigType.VLESS,
security = "none"
};
Uri url = new Uri(result);
item.address = url.IdnHost;
item.port = url.Port;
item.remarks = url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
item.id = url.UserInfo;
var query = HttpUtility.ParseQueryString(url.Query);
item.flow = query["flow"] ?? "";
item.security = query["encryption"] ?? "none";
item.streamSecurity = query["security"] ?? "";
item.sni = query["sni"] ?? "";
item.network = query["type"] ?? "tcp";
switch (item.network)
{
case "tcp":
item.headerType = query["headerType"] ?? "none";
item.requestHost = Utils.UrlDecode(query["host"] ?? "");
break;
case "kcp":
item.headerType = query["headerType"] ?? "none";
item.path = Utils.UrlDecode(query["seed"] ?? "");
break;
case "ws":
item.requestHost = Utils.UrlDecode(query["host"] ?? "");
item.path = Utils.UrlDecode(query["path"] ?? "/");
break;
case "http":
case "h2":
item.network = "h2";
item.requestHost = Utils.UrlDecode(query["host"] ?? "");
item.path = Utils.UrlDecode(query["path"] ?? "/");
break;
case "quic":
item.headerType = query["headerType"] ?? "none";
item.requestHost = query["quicSecurity"] ?? "none";
item.path = Utils.UrlDecode(query["key"] ?? "");
break;
default:
return null;
}
return item;
}
#endregion
}
}

View file

@ -190,7 +190,7 @@ namespace v2rayN.Handler
_updateFunc(testCounter, args.GetException().Message);
};
var timeout = 12;
var timeout = 10;
foreach (int itemIndex in _selecteds)
{
if (itemIndex >= _config.vmess.Count)
@ -289,7 +289,7 @@ namespace v2rayN.Handler
{
return "Timeout";
}
return string.Format("{0}{1}", time, unit).PadLeft(6, ' ');
return string.Format("{0}{1}", time, unit).PadLeft(8, ' ');
}
}
}

View file

@ -30,6 +30,7 @@ namespace v2rayN.Handler
get; set;
}
public List<ServerStatItem> Statistic
{
get
@ -191,6 +192,25 @@ namespace v2rayN.Handler
}
}
public void ClearAllServerStatistics()
{
if (serverStatistics_ != null)
{
foreach (var item in serverStatistics_.server)
{
item.todayUp = 0;
item.todayDown = 0;
item.totalUp = 0;
item.totalDown = 0;
// update ui display to zero
updateFunc_(0, 0, new List<ServerStatItem> { item });
}
// update statistic json file
SaveToFile();
}
}
private ServerStatItem GetServerStatItem(string itemId)
{
long ticks = DateTime.Now.Date.Ticks;

View file

@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
@ -80,7 +78,7 @@ namespace v2rayN.Handler
// TODO: 统计配置
statistic(config, ref v2rayConfig);
Utils.ToJsonFile(v2rayConfig, fileName);
Utils.ToJsonFile(v2rayConfig, fileName, false);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
}
@ -148,7 +146,7 @@ namespace v2rayN.Handler
try
{
Inbounds inbound = v2rayConfig.inbounds[0];
//端口
inbound.tag = Global.InboundSocks;
inbound.port = config.inbound[0].localPort;
inbound.protocol = config.inbound[0].protocol;
if (config.allowLANConn)
@ -159,9 +157,17 @@ namespace v2rayN.Handler
{
inbound.listen = Global.Loopback;
}
//开启udp
//udp
inbound.settings.udp = config.inbound[0].udpEnabled;
inbound.sniffing.enabled = config.inbound[0].sniffingEnabled;
//http
Inbounds inbound2 = v2rayConfig.inbounds[1];
inbound2.tag = Global.InboundHttp;
inbound2.port = config.GetLocalPort(Global.InboundHttp);
inbound2.protocol = Global.InboundHttp;
inbound2.listen = inbound.listen;
inbound2.settings.allowTransparent = false;
}
catch
{
@ -184,88 +190,26 @@ namespace v2rayN.Handler
{
v2rayConfig.routing.domainStrategy = config.domainStrategy;
//自定义
//需代理
routingUserRule(config.useragent, Global.agentTag, ref v2rayConfig);
//直连
routingUserRule(config.userdirect, Global.directTag, ref v2rayConfig);
//阻止
routingUserRule(config.userblock, Global.blockTag, ref v2rayConfig);
switch (config.routingMode)
if (config.enableRoutingAdvanced)
{
case "0":
break;
case "1":
routingGeo("ip", "private", Global.directTag, ref v2rayConfig);
break;
case "2":
routingGeo("", "cn", Global.directTag, ref v2rayConfig);
break;
case "3":
routingGeo("ip", "private", Global.directTag, ref v2rayConfig);
routingGeo("", "cn", Global.directTag, ref v2rayConfig);
break;
}
}
}
catch
{
}
return 0;
}
private static int routingUserRule(List<string> userRule, string tag, ref V2rayConfig v2rayConfig)
{
try
{
if (userRule != null
&& userRule.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))
if (config.routings != null && config.routingIndex < config.routings.Count)
{
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);
foreach (var item in config.routings[config.routingIndex].rules)
{
routingUserRule(item, ref v2rayConfig);
}
}
}
if (rulesDomain.domain.Count > 0)
else
{
v2rayConfig.routing.rules.Add(rulesDomain);
}
if (rulesIP.ip.Count > 0)
{
v2rayConfig.routing.rules.Add(rulesIP);
var lockedItem = ConfigHandler.GetLockedRoutingItem(ref config);
if (lockedItem != null)
{
foreach (var item in lockedItem.rules)
{
routingUserRule(item, ref v2rayConfig);
}
}
}
}
}
@ -274,38 +218,93 @@ namespace v2rayN.Handler
}
return 0;
}
private static int routingGeo(string ipOrDomain, string code, string tag, ref V2rayConfig v2rayConfig)
private static int routingUserRule(RulesItem rules, ref V2rayConfig v2rayConfig)
{
try
{
if (!Utils.IsNullOrEmpty(code))
if (rules == null)
{
//IP
if (ipOrDomain == "ip" || ipOrDomain == "")
{
RulesItem rulesItem = new RulesItem
{
type = "field",
outboundTag = Global.directTag,
ip = new List<string>()
};
rulesItem.ip.Add($"geoip:{code}");
return 0;
}
if (Utils.IsNullOrEmpty(rules.port))
{
rules.port = null;
}
if (rules.domain != null && rules.domain.Count == 0)
{
rules.domain = null;
}
if (rules.ip != null && rules.ip.Count == 0)
{
rules.ip = null;
}
if (rules.protocol != null && rules.protocol.Count == 0)
{
rules.protocol = null;
}
v2rayConfig.routing.rules.Add(rulesItem);
var hasDomainIp = false;
if (rules.domain != null && rules.domain.Count > 0)
{
var it = Utils.DeepCopy(rules);
it.ip = null;
it.type = "field";
for (int k = 0; k < it.domain.Count; k++)
{
it.domain[k] = it.domain[k].Replace(Global.RoutingRuleComma, ",");
}
if (ipOrDomain == "domain" || ipOrDomain == "")
//if (Utils.IsNullOrEmpty(it.port))
//{
// it.port = null;
//}
//if (it.protocol != null && it.protocol.Count == 0)
//{
// it.protocol = null;
//}
v2rayConfig.routing.rules.Add(it);
hasDomainIp = true;
}
if (rules.ip != null && rules.ip.Count > 0)
{
var it = Utils.DeepCopy(rules);
it.domain = null;
it.type = "field";
//if (Utils.IsNullOrEmpty(it.port))
//{
// it.port = null;
//}
//if (it.protocol != null && it.protocol.Count == 0)
//{
// it.protocol = null;
//}
v2rayConfig.routing.rules.Add(it);
hasDomainIp = true;
}
if (!hasDomainIp)
{
if (!Utils.IsNullOrEmpty(rules.port))
{
RulesItem rulesItem = new RulesItem
{
type = "field",
outboundTag = Global.directTag,
domain = new List<string>()
};
rulesItem.domain.Add($"geosite:{code}");
v2rayConfig.routing.rules.Add(rulesItem);
var it = Utils.DeepCopy(rules);
//it.domain = null;
//it.ip = null;
//if (it.protocol != null && it.protocol.Count == 0)
//{
// it.protocol = null;
//}
it.type = "field";
v2rayConfig.routing.rules.Add(it);
}
else if (rules.protocol != null && rules.protocol.Count > 0)
{
var it = Utils.DeepCopy(rules);
//it.domain = null;
//it.ip = null;
//if (Utils.IsNullOrEmpty(it.port))
//{
// it.port = null;
//}
it.type = "field";
v2rayConfig.routing.rules.Add(it);
}
}
}
@ -366,7 +365,7 @@ namespace v2rayN.Handler
StreamSettings streamSettings = outbound.streamSettings;
boundStreamSettings(config, "out", ref streamSettings);
outbound.protocol = "vmess";
outbound.protocol = Global.vmessProtocolLite;
outbound.settings.servers = null;
}
else if (config.configType() == (int)EConfigType.Shadowsocks)
@ -385,16 +384,24 @@ namespace v2rayN.Handler
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.password = config.id();
serversItem.method = config.security();
if (Global.ssSecuritys.Contains(config.security()))
{
serversItem.method = config.security();
}
else
{
serversItem.method = "none";
}
serversItem.ota = false;
serversItem.level = 1;
outbound.mux.enabled = false;
outbound.mux.concurrency = -1;
outbound.protocol = "shadowsocks";
outbound.protocol = Global.ssProtocolLite;
outbound.settings.vnext = null;
}
else if (config.configType() == (int)EConfigType.Socks)
@ -431,7 +438,98 @@ namespace v2rayN.Handler
outbound.mux.enabled = false;
outbound.mux.concurrency = -1;
outbound.protocol = "socks";
outbound.protocol = Global.socksProtocolLite;
outbound.settings.vnext = null;
}
else if (config.configType() == (int)EConfigType.VLESS)
{
VnextItem vnextItem;
if (outbound.settings.vnext.Count <= 0)
{
vnextItem = new VnextItem();
outbound.settings.vnext.Add(vnextItem);
}
else
{
vnextItem = outbound.settings.vnext[0];
}
//远程服务器地址和端口
vnextItem.address = config.address();
vnextItem.port = config.port();
UsersItem usersItem;
if (vnextItem.users.Count <= 0)
{
usersItem = new UsersItem();
vnextItem.users.Add(usersItem);
}
else
{
usersItem = vnextItem.users[0];
}
//远程服务器用户ID
usersItem.id = config.id();
usersItem.alterId = 0;
usersItem.flow = string.Empty;
usersItem.email = Global.userEMail;
usersItem.encryption = config.security();
//Mux
outbound.mux.enabled = config.muxEnabled;
outbound.mux.concurrency = config.muxEnabled ? 8 : -1;
//远程服务器底层传输配置
StreamSettings streamSettings = outbound.streamSettings;
boundStreamSettings(config, "out", ref streamSettings);
//if xtls
if (config.streamSecurity() == Global.StreamSecurityX)
{
if (Utils.IsNullOrEmpty(config.flow()))
{
usersItem.flow = "xtls-rprx-origin";
}
else
{
usersItem.flow = config.flow().Replace("splice", "direct");
}
outbound.mux.enabled = false;
outbound.mux.concurrency = -1;
}
outbound.protocol = Global.vlessProtocolLite;
outbound.settings.servers = null;
}
else if (config.configType() == (int)EConfigType.Trojan)
{
ServersItem serversItem;
if (outbound.settings.servers.Count <= 0)
{
serversItem = new ServersItem();
outbound.settings.servers.Add(serversItem);
}
else
{
serversItem = outbound.settings.servers[0];
}
//远程服务器地址和端口
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.password = config.id();
serversItem.ota = false;
serversItem.level = 1;
outbound.mux.enabled = false;
outbound.mux.concurrency = -1;
//远程服务器底层传输配置
StreamSettings streamSettings = outbound.streamSettings;
boundStreamSettings(config, "out", ref streamSettings);
outbound.protocol = Global.trojanProtocolLite;
outbound.settings.vnext = null;
}
}
@ -454,7 +552,9 @@ namespace v2rayN.Handler
{
//远程服务器底层传输配置
streamSettings.network = config.network();
string host = config.requestHost();
string host = config.requestHost();
string sni = config.sni();
//if tls
if (config.streamSecurity() == Global.StreamSecurity)
{
@ -464,13 +564,37 @@ namespace v2rayN.Handler
{
allowInsecure = config.allowInsecure()
};
if (!string.IsNullOrWhiteSpace(host))
if (!string.IsNullOrWhiteSpace(sni))
{
tlsSettings.serverName = host;
tlsSettings.serverName = sni;
}
else if (!string.IsNullOrWhiteSpace(host))
{
tlsSettings.serverName = Utils.String2List(host)[0];
}
streamSettings.tlsSettings = tlsSettings;
}
//if xtls
if (config.streamSecurity() == Global.StreamSecurityX)
{
streamSettings.security = config.streamSecurity();
TlsSettings xtlsSettings = new TlsSettings
{
allowInsecure = config.allowInsecure()
};
if (!string.IsNullOrWhiteSpace(sni))
{
xtlsSettings.serverName = sni;
}
else if (!string.IsNullOrWhiteSpace(host))
{
xtlsSettings.serverName = Utils.String2List(host)[0];
}
streamSettings.xtlsSettings = xtlsSettings;
}
//streamSettings
switch (config.network())
{
@ -504,13 +628,16 @@ namespace v2rayN.Handler
{
type = config.headerType()
};
if (!Utils.IsNullOrEmpty(config.path()))
{
kcpSettings.seed = config.path();
}
streamSettings.kcpSettings = kcpSettings;
break;
//ws
case "ws":
WsSettings wsSettings = new WsSettings
{
connectionReuse = true
};
string path = config.path();
@ -565,7 +692,14 @@ namespace v2rayN.Handler
streamSettings.quicSettings = quicsettings;
if (config.streamSecurity() == Global.StreamSecurity)
{
streamSettings.tlsSettings.serverName = config.address();
if (!string.IsNullOrWhiteSpace(sni))
{
streamSettings.tlsSettings.serverName = sni;
}
else
{
streamSettings.tlsSettings.serverName = config.address();
}
}
break;
default:
@ -574,7 +708,6 @@ namespace v2rayN.Handler
{
TcpSettings tcpSettings = new TcpSettings
{
connectionReuse = true,
header = new Header
{
type = config.headerType()
@ -631,21 +764,30 @@ namespace v2rayN.Handler
{
return 0;
}
List<string> servers = new List<string>();
string[] arrDNS = config.remoteDNS.Split(',');
foreach (string str in arrDNS)
var obj = Utils.ParseJson(config.remoteDNS);
if (obj != null && obj.ContainsKey("servers"))
{
//if (Utils.IsIP(str))
//{
servers.Add(str);
//}
v2rayConfig.dns = obj;
}
//servers.Add("localhost");
v2rayConfig.dns = new Mode.Dns
else
{
servers = servers
};
List<string> servers = new List<string>();
string[] arrDNS = config.remoteDNS.Split(',');
foreach (string str in arrDNS)
{
//if (Utils.IsIP(str))
//{
servers.Add(str);
//}
}
//servers.Add("localhost");
v2rayConfig.dns = new Mode.Dns
{
servers = servers
};
}
}
catch
{
@ -670,8 +812,8 @@ namespace v2rayN.Handler
apiObj.services = services.ToList();
v2rayConfig.api = apiObj;
policySystemSetting.statsInboundDownlink = true;
policySystemSetting.statsInboundUplink = true;
policySystemSetting.statsOutboundDownlink = true;
policySystemSetting.statsOutboundUplink = true;
policyObj.system = policySystemSetting;
v2rayConfig.policy = policyObj;
@ -804,7 +946,7 @@ namespace v2rayN.Handler
//传出设置
ServerOutbound(config, ref v2rayConfig);
Utils.ToJsonFile(v2rayConfig, fileName);
Utils.ToJsonFile(v2rayConfig, fileName, false);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
}
@ -842,9 +984,22 @@ namespace v2rayN.Handler
//远程服务器用户ID
usersItem.id = config.id();
usersItem.alterId = config.alterId();
usersItem.email = Global.userEMail;
if (config.configType() == (int)EConfigType.Vmess)
{
inbound.protocol = Global.vmessProtocolLite;
usersItem.alterId = config.alterId();
}
else if (config.configType() == (int)EConfigType.VLESS)
{
inbound.protocol = Global.vlessProtocolLite;
usersItem.alterId = 0;
usersItem.flow = config.flow();
inbound.settings.decryption = config.security();
}
//远程服务器底层传输配置
StreamSettings streamSettings = inbound.streamSettings;
boundStreamSettings(config, "in", ref streamSettings);
@ -918,7 +1073,7 @@ namespace v2rayN.Handler
Outbounds outbound = v2rayConfig.outbounds[0];
if (outbound == null
|| Utils.IsNullOrEmpty(outbound.protocol)
|| outbound.protocol != "vmess"
|| outbound.protocol != Global.vmessProtocolLite
|| outbound.settings == null
|| outbound.settings.vnext == null
|| outbound.settings.vnext.Count <= 0
@ -1064,7 +1219,7 @@ namespace v2rayN.Handler
Inbounds inbound = v2rayConfig.inbounds[0];
if (inbound == null
|| Utils.IsNullOrEmpty(inbound.protocol)
|| inbound.protocol != "vmess"
|| inbound.protocol != Global.vmessProtocolLite
|| inbound.settings == null
|| inbound.settings.clients == null
|| inbound.settings.clients.Count <= 0)
@ -1169,180 +1324,6 @@ namespace v2rayN.Handler
return vmessItem;
}
/// <summary>
/// 从剪贴板导入URL
/// </summary>
/// <param name="fileName"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static VmessItem ImportFromClipboardConfig(string clipboardData, out string msg)
{
msg = string.Empty;
VmessItem vmessItem = new VmessItem();
try
{
//载入配置文件
string result = clipboardData.TrimEx();// Utils.GetClipboardData();
if (Utils.IsNullOrEmpty(result))
{
msg = UIRes.I18N("FailedReadConfiguration");
return null;
}
if (result.StartsWith(Global.vmessProtocol))
{
int indexSplit = result.IndexOf("?");
if (indexSplit > 0)
{
vmessItem = ResolveVmess4Kitsunebi(result);
}
else
{
vmessItem.configType = (int)EConfigType.Vmess;
result = result.Substring(Global.vmessProtocol.Length);
result = Utils.Base64Decode(result);
//转成Json
VmessQRCode vmessQRCode = Utils.FromJson<VmessQRCode>(result);
if (vmessQRCode == null)
{
msg = UIRes.I18N("FailedConversionConfiguration");
return null;
}
vmessItem.security = Global.DefaultSecurity;
vmessItem.network = Global.DefaultNetwork;
vmessItem.headerType = Global.None;
vmessItem.configVersion = Utils.ToInt(vmessQRCode.v);
vmessItem.remarks = Utils.ToString(vmessQRCode.ps);
vmessItem.address = Utils.ToString(vmessQRCode.add);
vmessItem.port = Utils.ToInt(vmessQRCode.port);
vmessItem.id = Utils.ToString(vmessQRCode.id);
vmessItem.alterId = Utils.ToInt(vmessQRCode.aid);
if (!Utils.IsNullOrEmpty(vmessQRCode.net))
{
vmessItem.network = vmessQRCode.net;
}
if (!Utils.IsNullOrEmpty(vmessQRCode.type))
{
vmessItem.headerType = vmessQRCode.type;
}
vmessItem.requestHost = Utils.ToString(vmessQRCode.host);
vmessItem.path = Utils.ToString(vmessQRCode.path);
vmessItem.streamSecurity = Utils.ToString(vmessQRCode.tls);
}
ConfigHandler.UpgradeServerVersion(ref vmessItem);
}
else if (result.StartsWith(Global.ssProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem.configType = (int)EConfigType.Shadowsocks;
result = result.Substring(Global.ssProtocol.Length);
//remark
int indexRemark = result.IndexOf("#");
if (indexRemark > 0)
{
try
{
vmessItem.remarks = WebUtility.UrlDecode(result.Substring(indexRemark + 1, result.Length - indexRemark - 1));
}
catch { }
result = result.Substring(0, indexRemark);
}
//part decode
int indexS = result.IndexOf("@");
if (indexS > 0)
{
result = Utils.Base64Decode(result.Substring(0, indexS)) + result.Substring(indexS, result.Length - indexS);
}
else
{
result = Utils.Base64Decode(result);
}
string[] arr1 = result.Split('@');
if (arr1.Length != 2)
{
return null;
}
string[] arr21 = arr1[0].Split(':');
//string[] arr22 = arr1[1].Split(':');
int indexPort = arr1[1].LastIndexOf(":");
if (arr21.Length != 2 || indexPort < 0)
{
return null;
}
vmessItem.address = arr1[1].Substring(0, indexPort);
vmessItem.port = Utils.ToInt(arr1[1].Substring(indexPort + 1, arr1[1].Length - (indexPort + 1)));
vmessItem.security = arr21[0];
vmessItem.id = arr21[1];
}
else if (result.StartsWith(Global.socksProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem.configType = (int)EConfigType.Socks;
result = result.Substring(Global.socksProtocol.Length);
//remark
int indexRemark = result.IndexOf("#");
if (indexRemark > 0)
{
try
{
vmessItem.remarks = WebUtility.UrlDecode(result.Substring(indexRemark + 1, result.Length - indexRemark - 1));
}
catch { }
result = result.Substring(0, indexRemark);
}
//part decode
int indexS = result.IndexOf("@");
if (indexS > 0)
{
}
else
{
result = Utils.Base64Decode(result);
}
string[] arr1 = result.Split('@');
if (arr1.Length != 2)
{
return null;
}
string[] arr21 = arr1[0].Split(':');
//string[] arr22 = arr1[1].Split(':');
int indexPort = arr1[1].LastIndexOf(":");
if (arr21.Length != 2 || indexPort < 0)
{
return null;
}
vmessItem.address = arr1[1].Substring(0, indexPort);
vmessItem.port = Utils.ToInt(arr1[1].Substring(indexPort + 1, arr1[1].Length - (indexPort + 1)));
vmessItem.security = arr21[0];
vmessItem.id = arr21[1];
}
else
{
msg = UIRes.I18N("NonvmessOrssProtocol");
return null;
}
}
catch
{
msg = UIRes.I18N("Incorrectconfiguration");
return null;
}
return vmessItem;
}
/// <summary>
/// 导出为客户端配置
/// </summary>
@ -1367,45 +1348,6 @@ namespace v2rayN.Handler
return GenerateServerConfig(config, fileName, out msg);
}
private static VmessItem ResolveVmess4Kitsunebi(string result)
{
VmessItem vmessItem = new VmessItem
{
configType = (int)EConfigType.Vmess
};
result = result.Substring(Global.vmessProtocol.Length);
int indexSplit = result.IndexOf("?");
if (indexSplit > 0)
{
result = result.Substring(0, indexSplit);
}
result = Utils.Base64Decode(result);
string[] arr1 = result.Split('@');
if (arr1.Length != 2)
{
return null;
}
string[] arr21 = arr1[0].Split(':');
string[] arr22 = arr1[1].Split(':');
if (arr21.Length != 2 || arr21.Length != 2)
{
return null;
}
vmessItem.address = arr22[0];
vmessItem.port = Utils.ToInt(arr22[1]);
vmessItem.security = arr21[0];
vmessItem.id = arr21[1];
vmessItem.network = Global.DefaultNetwork;
vmessItem.headerType = Global.None;
vmessItem.remarks = "Alien";
vmessItem.alterId = 0;
return vmessItem;
}
#endregion
#region Gen speedtest config
@ -1427,7 +1369,7 @@ namespace v2rayN.Handler
msg = UIRes.I18N("InitialConfiguration");
Config configCopy = Utils.DeepCopy(config);
Config configCopy = Utils.DeepCopy(config);
string result = Utils.GetEmbedText(SampleClient);
if (Utils.IsNullOrEmpty(result))
@ -1447,7 +1389,7 @@ namespace v2rayN.Handler
//routing(config, ref v2rayConfig);
dns(configCopy, ref v2rayConfig);
v2rayConfig.inbounds.RemoveAt(0); // Remove "proxy" service for speedtest, avoiding port conflicts.
v2rayConfig.inbounds.Clear(); // Remove "proxy" service for speedtest, avoiding port conflicts.
int httpPort = configCopy.GetLocalPort("speedtest");
foreach (int index in selecteds)

View file

@ -22,17 +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>
{
"wv2ray",
"v2ray"
};
}
/// <summary>
@ -40,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);
@ -158,10 +172,11 @@ namespace v2rayN.Handler
}
}
private string V2rayFindexe() {
private string V2rayFindexe()
{
//查找v2ray文件是否存在
string fileName = string.Empty;
lstV2ray.Reverse();
//lstV2ray.Reverse();
foreach (string name in lstV2ray)
{
string vName = string.Format("{0}.exe", name);
@ -174,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;
@ -317,6 +332,6 @@ namespace v2rayN.Handler
{
Utils.SaveLog(ex.Message, ex);
}
}
}
}
}

View file

@ -10,23 +10,20 @@ namespace v2rayN.HttpProxyHandler
{
noHttpProxy = 0,
GlobalHttp = 1,
GlobalPac = 2,
HttpOpenAndClear = 3,
PacOpenAndClear = 4,
HttpOpenOnly = 5,
PacOpenOnly = 6
HttpOpenAndClear = 2,
HttpOpenOnly = 3,
}
/// <summary>
/// 系统代理(http)总处理
/// 启动privoxy提供http协议
/// 设置IE系统代理或者PAC模式
/// 设置IE系统代理
/// </summary>
class HttpProxyHandle
{
private static bool Update(Config config, bool forceDisable)
{
ListenerType type = config.listenerType;
// ListenerType type = config.listenerType;
var type = ListenerType.noHttpProxy;
if (forceDisable)
{
type = ListenerType.noHttpProxy;
@ -43,47 +40,21 @@ namespace v2rayN.HttpProxyHandler
}
if (type == ListenerType.GlobalHttp)
{
//PACServerHandle.Stop();
//ProxySetting.SetProxy($"{Global.Loopback}:{port}", Global.IEProxyExceptions, 2);
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}");
}
else if (type == ListenerType.GlobalPac)
{
string pacUrl = GetPacUrl();
//ProxySetting.SetProxy(pacUrl, "", 4);
SysProxyHandle.SetIEProxy(true, false, pacUrl);
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
else if (type == ListenerType.HttpOpenAndClear)
{
//PACServerHandle.Stop();
SysProxyHandle.ResetIEProxy();
}
else if (type == ListenerType.PacOpenAndClear)
{
string pacUrl = GetPacUrl();
SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
else if (type == ListenerType.HttpOpenOnly)
{
//PACServerHandle.Stop();
//SysProxyHandle.ResetIEProxy();
}
else if (type == ListenerType.PacOpenOnly)
{
string pacUrl = GetPacUrl();
//SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
}
else
{
SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
}
}
catch (Exception ex)
@ -110,7 +81,6 @@ namespace v2rayN.HttpProxyHandler
Global.sysAgent = true;
Global.socksPort = localPort;
Global.httpPort = PrivoxyHandler.Instance.RunningPort;
Global.pacPort = config.GetLocalPort("pac");
}
}
}
@ -127,10 +97,10 @@ namespace v2rayN.HttpProxyHandler
{
try
{
if (config.listenerType != ListenerType.HttpOpenOnly && config.listenerType != ListenerType.PacOpenOnly)
{
Update(config, true);
}
//if (config.listenerType != ListenerType.HttpOpenOnly)
//{
// Update(config, true);
//}
PrivoxyHandler.Instance.Stop();
@ -151,11 +121,11 @@ namespace v2rayN.HttpProxyHandler
public static void RestartHttpAgent(Config config, bool forced)
{
bool isRestart = false;
if (config.listenerType == ListenerType.noHttpProxy)
{
// 关闭http proxy时直接返回
return;
}
//if (config.listenerType == ListenerType.noHttpProxy)
//{
// // 关闭http proxy时直接返回
// return;
//}
//强制重启或者socks端口变化
if (forced)
{
@ -177,10 +147,40 @@ namespace v2rayN.HttpProxyHandler
Update(config, false);
}
public static string GetPacUrl()
public static bool UpdateSysProxy(Config config, bool forceDisable)
{
string pacUrl = $"http://{Global.Loopback}:{Global.pacPort}/pac/?t={ DateTime.Now.ToString("HHmmss")}";
return pacUrl;
var type = config.sysProxyType;
if (forceDisable)
{
type = ESysProxyType.ForcedClear;
}
try
{
Global.httpPort = config.GetLocalPort(Global.InboundHttp);
int port = Global.httpPort;
if (port <= 0)
{
return false;
}
if (type == ESysProxyType.ForcedChange)
{
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}");
}
else if (type == ESysProxyType.ForcedClear)
{
SysProxyHandle.ResetIEProxy();
}
else if (type == ESysProxyType.Unchanged)
{
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
return true;
}
}
}

View file

@ -1,209 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.Tool;
using v2rayN.Base;
namespace v2rayN.HttpProxyHandler
{
/// <summary>
/// 提供PAC功能支持
/// </summary>
class PACServerHandle
{
private static int pacPort = 0;
private static HttpWebServer server;
private static HttpWebServerB serverB;
private static Config _config;
public static bool IsRunning
{
get
{
return (pacPort > 0);
}
}
public static void Init(Config config)
{
_config = config;
Global.pacPort = config.GetLocalPort("pac");
if (InitServer("*"))
{
pacPort = Global.pacPort;
}
//else if (InitServer(Global.Loopback))
//{
// pacPort = Global.pacPort;
//}
else if (InitServerB(Global.Loopback))
{
pacPort = Global.pacPort;
}
else
{
Utils.SaveLog("Webserver init failed ");
pacPort = 0;
}
}
private static bool InitServer(string address)
{
try
{
if (pacPort != Global.pacPort)
{
if (server != null)
{
server.Stop();
server = null;
}
if (server == null)
{
string prefixes = string.Format("http://{0}:{1}/pac/", address, Global.pacPort);
Utils.SaveLog("Webserver prefixes " + prefixes);
server = new HttpWebServer(SendResponse, prefixes);
server.Run();
}
}
Utils.SaveLog("Webserver at " + address);
}
catch (Exception ex)
{
Utils.SaveLog("Webserver InitServer " + ex.Message);
return false;
}
return true;
}
public static bool InitServerB(string address)
{
try
{
if (pacPort != Global.pacPort)
{
if (serverB != null)
{
serverB.Stop();
serverB = null;
}
if (serverB == null)
{
serverB = new HttpWebServerB(Global.pacPort, SendResponse);
}
}
Utils.SaveLog("WebserverB at " + address);
}
catch (Exception ex)
{
Utils.SaveLog("WebserverB InitServer " + ex.Message);
return false;
}
return true;
}
public static string SendResponse(string address)
{
try
{
string pac = GetPacList(address);
return pac;
}
catch (Exception ex)
{
Utils.SaveLog("Webserver SendResponse " + ex.Message);
return ex.Message;
}
}
public static void Stop()
{
try
{
if (server != null)
{
server.Stop();
server = null;
}
if (serverB != null)
{
serverB.Stop();
serverB = null;
}
}
catch (Exception ex)
{
Utils.SaveLog("Webserver Stop " + ex.Message);
}
//try
//{
// if (httpWebServer == null)
// {
// return;
// }
// foreach (var key in httpWebServer.Keys)
// {
// Utils.SaveLog("Webserver Stop " + key.ToString());
// ((HttpWebServer)httpWebServer[key]).Stop();
// }
// httpWebServer.Clear();
//}
//catch (Exception ex)
//{
// Utils.SaveLog("Webserver Stop " + ex.Message);
//}
}
private static string GetPacList(string address)
{
int port = Global.httpPort;
if (port <= 0)
{
return "No port";
}
try
{
List<string> lstProxy = new List<string>
{
string.Format("PROXY {0}:{1};", address, port)
};
string proxy = string.Join("", lstProxy.ToArray());
string strPacfile = Utils.GetPath(Global.pacFILE);
if (!File.Exists(strPacfile))
{
FileManager.UncompressFile(strPacfile, Resources.pac_txt);
}
string pac = File.ReadAllText(strPacfile, Encoding.UTF8);
pac = pac.Replace("__PROXY__", proxy);
if (_config.userPacRule.Count > 0)
{
string keyWords = "var rules = [";
if (pac.IndexOf(keyWords) >= 0)
{
string userPac = string.Join($"\",{Environment.NewLine}\"", _config.userPacRule.ToArray());
userPac = string.Format("\"{0}\",", userPac);
pac = pac.Replace(keyWords, keyWords + userPac);
}
}
return pac;
}
catch
{
}
return "No pac content";
}
}
}

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

@ -0,0 +1,14 @@
namespace v2rayN.Mode
{
class ComboItem
{
public int ID
{
get; set;
}
public string Text
{
get; set;
}
}
}

View file

@ -60,46 +60,6 @@ namespace v2rayN.Mode
get; set;
}
/// <summary>
/// 域名解析策略
/// </summary>
public string domainStrategy
{
get; set;
}
/// <summary>
/// 路由模式
/// </summary>
public string routingMode
{
get; set;
}
/// <summary>
/// 用户自定义需代理的网址或ip
/// </summary>
public List<string> useragent
{
get; set;
}
/// <summary>
/// 用户自定义直连的网址或ip
/// </summary>
public List<string> userdirect
{
get; set;
}
/// <summary>
/// 用户自定义阻止的网址或ip
/// </summary>
public List<string> userblock
{
get; set;
}
/// <summary>
/// KcpItem
/// </summary>
@ -109,9 +69,9 @@ namespace v2rayN.Mode
}
/// <summary>
/// 监听状态
///
/// </summary>
public ListenerType listenerType
public ESysProxyType sysProxyType
{
get; set;
}
@ -130,13 +90,6 @@ namespace v2rayN.Mode
{
get; set;
}
/// <summary>
/// 自定义GFWList url
/// </summary>
public string urlGFWList
{
get; set;
}
/// <summary>
/// 允许来自局域网的连接
@ -201,8 +154,31 @@ namespace v2rayN.Mode
{
get; set;
}
/// <summary>
/// 域名解析策略
/// </summary>
public string domainStrategy
{
get; set;
}
public int routingIndex
{
get; set;
}
public List<RoutingItem> routings
{
get; set;
}
public bool enableRoutingAdvanced
{
get; set;
}
public List<string> userPacRule
public ECoreType coreType
{
get; set;
}
public bool ignoreGeoUpdateCore
{
get; set;
}
@ -317,10 +293,7 @@ namespace v2rayN.Mode
{
return GetLocalPort(Global.InboundSocks) + 1;
}
else if (protocol == "pac")
{
return GetLocalPort(Global.InboundSocks) + 2;
}
else if (protocol == "speedtest")
{
return GetLocalPort(Global.InboundSocks) + 103;
@ -365,7 +338,22 @@ namespace v2rayN.Mode
return vmess[index].getItemId();
}
public string flow()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].flow.TrimEx();
}
public string sni()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].sni.TrimEx();
}
#endregion
}
@ -391,11 +379,12 @@ namespace v2rayN.Mode
configType = (int)EConfigType.Vmess;
testResult = string.Empty;
subid = string.Empty;
flow = string.Empty;
}
public string getSummary()
{
string summary = string.Format("{0}-", ((EConfigType)configType).ToString());
string summary = string.Format("[{0}] ", ((EConfigType)configType).ToString());
string[] arrAddr = address.Split('.');
string addr;
if (arrAddr.Length > 2)
@ -410,21 +399,26 @@ namespace v2rayN.Mode
{
addr = address;
}
if (configType == (int)EConfigType.Vmess)
switch (configType)
{
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
}
else if (configType == (int)EConfigType.Shadowsocks)
{
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
}
else if (configType == (int)EConfigType.Socks)
{
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
}
else
{
summary += string.Format("{0}", remarks);
case (int)EConfigType.Vmess:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
case (int)EConfigType.Shadowsocks:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
case (int)EConfigType.Socks:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
case (int)EConfigType.VLESS:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
case (int)EConfigType.Trojan:
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
break;
default:
summary += string.Format("{0}", remarks);
break;
}
return summary;
}
@ -578,6 +572,21 @@ namespace v2rayN.Mode
{
get; set;
}
/// <summary>
/// VLESS flow
/// </summary>
public string flow
{
get; set;
}
/// <summary>
/// tls sni
/// </summary>
public string sni
{
get; set;
}
}
[Serializable]

View file

@ -6,6 +6,8 @@ namespace v2rayN.Mode
Vmess = 1,
Custom = 2,
Shadowsocks = 3,
Socks = 4
Socks = 4,
VLESS = 5,
Trojan = 6
}
}

View file

@ -0,0 +1,9 @@

namespace v2rayN.Mode
{
public enum ECoreType
{
v2fly_core = 0,
Xray_core = 1
}
}

View file

@ -0,0 +1,10 @@

namespace v2rayN.Mode
{
public enum ESysProxyType
{
ForcedClear = 0,
ForcedChange = 1,
Unchanged = 2
}
}

View file

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace v2rayN.Mode
{
[Serializable]
public class RoutingItem
{
public string remarks
{
get; set;
}
public string url
{
get; set;
}
public List<RulesItem> rules
{
get; set;
}
public bool enabled { get; set; } = true;
public bool locked
{
get; set;
}
}
}

View file

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

View file

@ -35,7 +35,7 @@ namespace v2rayN.Mode
/// <summary>
/// DNS 配置
/// </summary>
public Dns dns { get; set; }
public object dns { get; set; }
/// <summary>
/// 路由配置
/// </summary>
@ -57,8 +57,8 @@ namespace v2rayN.Mode
public class SystemPolicy
{
public bool statsInboundUplink;
public bool statsInboundDownlink;
public bool statsOutboundUplink;
public bool statsOutboundDownlink;
}
public class Log
@ -132,6 +132,15 @@ namespace v2rayN.Mode
///
/// </summary>
public List<UsersItem> clients { get; set; }
/// <summary>
/// VLESS
/// </summary>
public string decryption { get; set; }
public bool allowTransparent { get; set; }
}
public class UsersItem
@ -152,6 +161,16 @@ namespace v2rayN.Mode
///
/// </summary>
public string security { get; set; }
/// <summary>
/// VLESS
/// </summary>
public string encryption { get; set; }
/// <summary>
/// VLESS
/// </summary>
public string flow { get; set; }
}
public class Sniffing
{
@ -304,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>
@ -381,7 +372,12 @@ namespace v2rayN.Mode
/// QUIC
/// </summary>
public QuicSettings quicSettings { get; set; }
/// <summary>
/// VLESS xtls
/// </summary>
public TlsSettings xtlsSettings { get; set; }
}
public class TlsSettings
@ -398,11 +394,7 @@ namespace v2rayN.Mode
}
public class TcpSettings
{
/// <summary>
/// 是否重用 TCP 连接
/// </summary>
public bool connectionReuse { get; set; }
{
/// <summary>
/// 数据包头部伪装设置
/// </summary>
@ -459,15 +451,14 @@ namespace v2rayN.Mode
///
/// </summary>
public Header header { get; set; }
}
public class WsSettings
{
/// <summary>
///
/// </summary>
public bool connectionReuse { get; set; }
public string seed { get; set; }
}
public class WsSettings
{
/// <summary>
///
/// </summary>

View file

@ -49,5 +49,9 @@ namespace v2rayN.Mode
/// 底层传输安全
/// </summary>
public string tls { get; set; } = string.Empty;
}
/// <summary>
/// SNI
/// </summary>
public string sni { get; set; } = string.Empty;
}
}

View file

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

View file

@ -19,7 +19,7 @@ namespace v2rayN.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@ -70,16 +70,6 @@ namespace v2rayN.Properties {
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] abp_js {
get {
object obj = ResourceManager.GetObject("abp_js", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
@ -130,33 +120,6 @@ namespace v2rayN.Properties {
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] pac_txt {
get {
object obj = ResourceManager.GetObject("pac_txt", resourceCulture);
return ((byte[])(obj));
}
}
/// <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,21 +151,12 @@
<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>
<data name="pac_txt" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pac.txt.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="help" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="abp_js" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\abp.js.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="share" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\share.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

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 {
@ -312,6 +312,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Count 的本地化字符串。
/// </summary>
internal static string LvCount {
get {
return ResourceManager.GetString("LvCount", resourceCulture);
}
}
/// <summary>
/// 查找类似 Security 的本地化字符串。
/// </summary>
@ -330,6 +339,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 remarks 的本地化字符串。
/// </summary>
internal static string LvRemarks {
get {
return ResourceManager.GetString("LvRemarks", resourceCulture);
}
}
/// <summary>
/// 查找类似 Type 的本地化字符串。
/// </summary>
@ -402,6 +420,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Url 的本地化字符串。
/// </summary>
internal static string LvUrl {
get {
return ResourceManager.GetString("LvUrl", resourceCulture);
}
}
/// <summary>
/// 查找类似 MediumFresh 的本地化字符串。
/// </summary>
@ -447,6 +474,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Please fill in the address (Url) 的本地化字符串。
/// </summary>
internal static string MsgNeedUrl {
get {
return ResourceManager.GetString("MsgNeedUrl", resourceCulture);
}
}
/// <summary>
/// 查找类似 No valid subscriptions set 的本地化字符串。
/// </summary>
@ -627,6 +663,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 +699,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 +735,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>
@ -690,6 +753,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 {0},One of the required. 的本地化字符串。
/// </summary>
internal static string RoutingRuleDetailRequiredTips {
get {
return ResourceManager.GetString("RoutingRuleDetailRequiredTips", resourceCulture);
}
}
/// <summary>
/// 查找类似 The client configuration file is saved at: {0} 的本地化字符串。
/// </summary>

View file

@ -361,4 +361,28 @@
<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>
<data name="RoutingRuleDetailRequiredTips" xml:space="preserve">
<value>{0},One of the required.</value>
</data>
<data name="LvRemarks" xml:space="preserve">
<value>remarks</value>
</data>
<data name="LvUrl" xml:space="preserve">
<value>Url</value>
</data>
<data name="LvCount" xml:space="preserve">
<value>Count</value>
</data>
<data name="MsgNeedUrl" xml:space="preserve">
<value>Please fill in the address (Url)</value>
</data>
</root>

View file

@ -361,4 +361,28 @@
<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>
<data name="RoutingRuleDetailRequiredTips" xml:space="preserve">
<value>{0},必填其中一项.</value>
</data>
<data name="LvRemarks" xml:space="preserve">
<value>别名</value>
</data>
<data name="LvUrl" xml:space="preserve">
<value>地址(Url)</value>
</data>
<data name="LvCount" xml:space="preserve">
<value>数量</value>
</data>
<data name="MsgNeedUrl" xml:space="preserve">
<value>请填写地址(Url)</value>
</data>
</root>

Binary file not shown.

View file

@ -1,5 +0,0 @@
var proxy = "__PROXY__";
function FindProxyForURL(url, host) {
return proxy;
}

View file

@ -1,17 +1,11 @@
{
"log": {
"access": "",
"error": "",
"loglevel": "error"
},
{
"log": {
"access": "Vaccess.log",
"error": "Verror.log",
"loglevel": "warning"
},
"inbounds": [
{
"tag": "proxy",
"inbounds": [{
"tag": "tag1",
"port": 10808,
"protocol": "socks",
"listen": "127.0.0.1",
@ -26,6 +20,22 @@
"tls"
]
}
},
{
"tag": "tag2",
"port": 10809,
"protocol": "socks",
"listen": "127.0.0.1",
"settings": {
"allowTransparent": false
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [{

View file

@ -1 +0,0 @@
geosite:category-ads,

Some files were not shown because too many files have changed in this diff Show more