Compare commits

...

39 Commits
3.9 ... 3.13

Author SHA1 Message Date
2dust
3af13d64f3 add defaultAllowInsecure 2020-03-31 16:57:54 +08:00
2dust
f1e51ae1a3 Priority high 2020-03-31 16:57:01 +08:00
2dust
6d2a1e0e9c Update MainForm.cs 2020-03-30 20:02:45 +08:00
2dust
ac2d71d7b0 up 2020-03-30 16:01:45 +08:00
2dust
002a8c505c Merge pull request #612 from DevSplash/dev
修复“克隆服务器”未带入allowInsecure的问题
2020-03-30 08:21:26 +08:00
Splash
49355da702 修复“克隆服务器”未带入allowInsecure的问题 2020-03-27 15:29:19 +08:00
2dust
3b38dc51ba Merge branch 'master' of https://github.com/2dust/v2rayN 2020-03-27 13:19:10 +08:00
2dust
3a27b56cc1 Update QRCodeControl.cs 2020-03-27 13:18:44 +08:00
2dust
fbb9c3cd64 Update README.md 2020-03-26 11:27:14 +08:00
2dust
07bdcb5491 Update AssemblyInfo.cs 2020-03-25 13:19:42 +08:00
2dust
01ac3be89f Merge pull request #591 from yfdyh000/fix_list
Workaround for list misalignment
2020-03-25 10:31:23 +08:00
YFdyh000
5f90b5b4c4 Workaround for list misalignment 2020-03-25 10:27:26 +08:00
2dust
a616ba50c2 up 2020-03-25 08:56:00 +08:00
2dust
3ebaabc1ef Merge pull request #573 from yfdyh000/netbuild
规范依赖文件的结构
2020-03-23 08:35:53 +08:00
2dust
1510549663 Merge pull request #572 from yfdyh000/pr6
代码优化;测速进程出错回报;域名解析策略 文档链接
2020-03-23 08:32:47 +08:00
YFdyh000
db0a757a49 Migrate to PackageReference 2020-03-21 11:03:10 +08:00
YFdyh000
20ab51e339 使v2rayUpgrade.exe支持更新自身 2020-03-21 09:38:37 +08:00
YFdyh000
948b9c26d9 妥善处理依赖
舍弃释放libs.zip,增加启动速度、代码安全性,减少.git占用
2020-03-21 09:38:34 +08:00
YFdyh000
300a4d8067 域名解析策略 补充说明 2020-03-21 09:24:05 +08:00
YFdyh000
a65afd7524 Better startup error checking & fix bug 2020-03-21 03:20:49 +08:00
YFdyh000
d8458e84f4 refine code 2020-03-21 03:20:49 +08:00
YFdyh000
a6664fbc01 ListViewItem引用列名称,增加代码可靠性 2020-03-21 03:20:46 +08:00
2dust
111f77c59c up 2020-03-20 16:23:12 +08:00
2dust
48218a3dad Merge pull request #567 from yfdyh000/pr5
功能和代码优化
2020-03-20 09:23:05 +08:00
YFdyh000
ec3eb2215b 预防闪退 2020-03-20 08:45:33 +08:00
YFdyh000
a6fcf53b10 'int' convert to 'enum ListenerType' 2020-03-20 07:53:05 +08:00
YFdyh000
be9bbcc2c7 add check 2020-03-20 07:53:04 +08:00
YFdyh000
a4a0b29250 refine merge 2020-03-20 07:53:01 +08:00
YFdyh000
01b34dd45a Merge remote-tracking branch 'remotes/Code-Fight/master' into pr5 2020-03-20 07:15:22 +08:00
YFdyh000
2d2e4deb82 清理代码
跳过证书验证存风险
强制HTTP1.0已知存有兼容性问题
2020-03-20 06:34:00 +08:00
YFdyh000
3daa8f479c 更新时使用代理(如可用) 2020-03-20 06:32:28 +08:00
YFdyh000
d2ab186e44 Add TestMe button 2020-03-20 06:32:27 +08:00
YFdyh000
5b2a6b12af 增强程序更新成功率 2020-03-20 06:32:26 +08:00
YFdyh000
5357f504d8 隔行着色 2020-03-20 06:32:25 +08:00
YFdyh000
df427d80a1 启用项粗体+蓝色 2020-03-20 06:32:24 +08:00
YFdyh000
b1f5d5ad75 cleanup 2020-03-20 06:32:24 +08:00
YFdyh000
af71eed96e 简化代码 2020-03-20 06:32:23 +08:00
YFdyh000
6293ddacc6 fix 2020-03-20 06:32:23 +08:00
zfcode
c1bb333555 add tray menu:subscription for updates 2020-02-27 14:17:33 +08:00
47 changed files with 1890 additions and 1153 deletions

5
.gitignore vendored
View File

@@ -5,10 +5,9 @@
/v2rayN/.vs/
/v2rayN/v2rayN/bin/Debug/app.publish
/v2rayN/v2rayN/bin/Debug
/v2rayN/v2rayN/obj/Debug
/v2rayN/.vs/v2rayN/DesignTimeBuild
/v2rayN/v2rayN/bin/Release
/v2rayN/v2rayN/obj/Release
/v2rayN/v2rayN/obj/
/v2rayN/.vs/v2rayN/DesignTimeBuild
/v2rayN/packages
.vs/ProjectSettings.json
.vs/slnx.sqlite

View File

@@ -1,8 +1,8 @@
# v2rayN
### How to use
- Download exe from release download
- Also need to download v2ray core in the same folder
- If you are newbie please download v2rayN-Core.zip from releases
- Otherwise please download v2rayN.zip (Also need to download v2ray core in the same folder)
- Run v2rayN.exe
### Requirements

View File

@@ -35,25 +35,32 @@ namespace v2rayN.Base
private void StartListen()
{
listener = new TcpListener(IPAddress.Any, port);
listener.Start();
Utils.SaveLog("WebserverB running...");
while (true)
try
{
if (!listener.Pending())
{
Thread.Sleep(100);
continue;
}
listener = new TcpListener(IPAddress.Any, port);
listener.Start();
Utils.SaveLog("WebserverB running...");
TcpClient socket = listener.AcceptTcpClient();
Thread thread = new Thread(new ParameterizedThreadStart(ProcessThread))
while (true)
{
IsBackground = true
};
thread.Start(socket);
Thread.Sleep(1);
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)

View File

@@ -17,17 +17,7 @@ namespace v2rayN.Base
protected override WebRequest GetWebRequest(Uri address)
{
HttpWebRequest request;
if (address.Scheme == "https")
{
ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) => { return true; };
request = (HttpWebRequest)base.GetWebRequest(address);
//request.ProtocolVersion = HttpVersion.Version10;
}
else
{
request = (HttpWebRequest)base.GetWebRequest(address);
}
request = (HttpWebRequest)base.GetWebRequest(address);
request.Timeout = Timeout;
request.ReadWriteTimeout = Timeout;
//request.AllowAutoRedirect = false;

View File

@@ -153,7 +153,4 @@
<data name="menuItemImportClipboard.Text" xml:space="preserve">
<value>从剪贴板导入URL</value>
</data>
<data name="menuItemScanScreen.Text" xml:space="preserve">
<value>扫描屏幕上的二维码</value>
</data>
</root>

View File

@@ -55,13 +55,14 @@
this.menuTcpingServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuRealPingServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuSpeedServer = new System.Windows.Forms.ToolStripMenuItem();
this.tsbTestMe = 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();
this.menuExport2ShareUrl = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2SubContent = new System.Windows.Forms.ToolStripMenuItem();
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
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();
@@ -76,6 +77,7 @@
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();
this.bgwScan = new System.ComponentModel.BackgroundWorker();
@@ -193,6 +195,7 @@
this.menuTcpingServer,
this.menuRealPingServer,
this.menuSpeedServer,
this.tsbTestMe,
this.toolStripSeparator6,
this.menuExport2ClientConfig,
this.menuExport2ServerConfig,
@@ -331,6 +334,12 @@
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
this.menuSpeedServer.Click += new System.EventHandler(this.menuSpeedServer_Click);
//
// tsbTestMe
//
this.tsbTestMe.Name = "tsbTestMe";
resources.ApplyResources(this.tsbTestMe, "tsbTestMe");
this.tsbTestMe.Click += new System.EventHandler(this.tsbTestMe_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
@@ -360,6 +369,11 @@
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
//
// qrCodeControl
//
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
this.qrCodeControl.Name = "qrCodeControl";
//
// tsbServer
//
this.tsbServer.DropDown = this.cmsLv;
@@ -367,11 +381,6 @@
resources.ApplyResources(this.tsbServer, "tsbServer");
this.tsbServer.Name = "tsbServer";
//
// qrCodeControl
//
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
this.qrCodeControl.Name = "qrCodeControl";
//
// notifyMain
//
this.notifyMain.ContextMenuStrip = this.cmsMain;
@@ -388,6 +397,7 @@
this.menuAddServers2,
this.menuScanScreen2,
this.menuCopyPACUrl,
this.menuUpdateSubscriptions,
this.toolStripSeparator2,
this.menuExit});
this.cmsMain.Name = "contextMenuStrip1";
@@ -473,6 +483,12 @@
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.Click += new System.EventHandler(this.menuUpdateSubscriptions_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
@@ -811,7 +827,7 @@
}
#endregion
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
@@ -835,7 +851,6 @@
private System.Windows.Forms.ToolStrip tsMain;
private System.Windows.Forms.ToolStripDropDownButton tsbServer;
private System.Windows.Forms.ToolStripButton tsbOptionSetting;
private System.Windows.Forms.ToolStripButton tsbReload;
private System.Windows.Forms.ToolStripButton tsbClose;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
@@ -901,9 +916,12 @@
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;
}
}

View File

@@ -9,6 +9,8 @@ using v2rayN.Mode;
using v2rayN.Base;
using v2rayN.Tool;
using System.Diagnostics;
using System.Drawing;
using System.Net;
namespace v2rayN.Forms
{
@@ -191,8 +193,12 @@ namespace v2rayN.Forms
VmessItem item = config.vmess[k];
ListViewItem lvItem = null;
if (statistics != null && statistics.Enable)
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)
{
ServerStatItem sItem = statistics.Statistic.Find(item_ => item_.itemId == item.getItemId());
if (sItem != null)
@@ -202,42 +208,35 @@ namespace v2rayN.Forms
todayUp = Utils.HumanFy(sItem.todayUp);
todayDown = Utils.HumanFy(sItem.todayDown);
}
lvItem = new ListViewItem(new string[]
{
def,
((EConfigType)item.configType).ToString(),
item.remarks,
item.address,
item.port.ToString(),
//item.id,
//item.alterId.ToString(),
item.security,
item.network,
item.getSubRemarks(config),
item.testResult,
todayDown,
todayUp,
totalDown,
totalUp
});
}
else
ListViewItem lvItem = new ListViewItem(def);
_addSubItem(lvItem, "type", ((EConfigType)item.configType).ToString());
_addSubItem(lvItem, "remarks", item.remarks);
_addSubItem(lvItem, "address", item.address);
_addSubItem(lvItem, "port", item.port.ToString());
//_addSubItem(lvItem, "id", item.id);
//_addSubItem(lvItem, "alterId", item.alterId.ToString());
_addSubItem(lvItem, "security", item.security);
_addSubItem(lvItem, "network", item.network);
_addSubItem(lvItem, "SubRemarks", item.getSubRemarks(config));
_addSubItem(lvItem, "testResult", item.testResult);
if (stats)
{
lvItem = new ListViewItem(new string[]
{
def,
((EConfigType)item.configType).ToString(),
item.remarks,
item.address,
item.port.ToString(),
//item.id,
//item.alterId.ToString(),
item.security,
item.network,
item.getSubRemarks(config),
item.testResult
});
_addSubItem(lvItem, "todayDown", todayDown);
_addSubItem(lvItem, "todayUp", todayUp);
_addSubItem(lvItem, "totalDown", totalDown);
_addSubItem(lvItem, "totalUp", totalUp);
}
if (k % 2 == 1) // 隔行着色
{
lvItem.BackColor = Color.WhiteSmoke;
}
if (config.index.Equals(k))
{
//lvItem.Checked = true;
lvItem.ForeColor = Color.DodgerBlue;
lvItem.Font = new Font(lvItem.Font, FontStyle.Bold);
}
if (lvItem != null) lvServers.Items.Add(lvItem);
@@ -322,10 +321,12 @@ namespace v2rayN.Forms
toolSslSocksPort.Text = $"{Global.Loopback}:{config.inbound[0].localPort}";
if (config.listenerType != 0)
if (config.listenerType != (int)ListenerType.noHttpProxy)
{
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
if (config.listenerType % 2 == 0)
if (config.listenerType == ListenerType.GlobalPac ||
config.listenerType == ListenerType.PacOpenAndClear ||
config.listenerType == ListenerType.PacOpenOnly)
{
if (PACServerHandle.IsRunning)
{
@@ -566,7 +567,7 @@ namespace v2rayN.Forms
private void menuRemoveDuplicateServer_Click(object sender, EventArgs e)
{
Utils.DedupServerList(config.vmess, out List<VmessItem> servers, config.keepOlderDedupl);
Utils.DedupServerList(config.vmess, out List<VmessItem> servers, config.keepOlderDedupl);
int oldCount = config.vmess.Count;
int newCount = servers.Count;
if (servers != null)
@@ -640,7 +641,7 @@ namespace v2rayN.Forms
}
private void Speedtest(string actionType)
{
GetLvSelectedIndex();
if (GetLvSelectedIndex() < 0) return;
ClearTestResult();
SpeedtestHandler statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, actionType, UpdateSpeedtestHandler);
}
@@ -871,6 +872,11 @@ namespace v2rayN.Forms
return counter;
}
private void menuUpdateSubscriptions_Click(object sender, EventArgs e)
{
UpdateSubscriptionProcess();
}
#endregion
@@ -1002,7 +1008,7 @@ namespace v2rayN.Forms
private void SetTestResult(int k, string txt)
{
config.vmess[k].testResult = txt;
lvServers.Items[k].SubItems[8].Text = txt;
lvServers.Items[k].SubItems["testResult"].Text = txt;
}
private void ClearTestResult()
{
@@ -1041,11 +1047,10 @@ namespace v2rayN.Forms
{
lvServers.SuspendLayout();
int indexStart = 9;
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayDown);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayUp);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalDown);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalUp);
lvServers.Items[i].SubItems["todayDown"].Text = Utils.HumanFy(statistics[index].todayDown);
lvServers.Items[i].SubItems["todayUp"].Text = Utils.HumanFy(statistics[index].todayUp);
lvServers.Items[i].SubItems["totalDown"].Text = Utils.HumanFy(statistics[index].totalDown);
lvServers.Items[i].SubItems["totalUp"].Text = Utils.HumanFy(statistics[index].totalUp);
lvServers.ResumeLayout();
});
@@ -1116,41 +1121,41 @@ namespace v2rayN.Forms
private void menuNotEnabledHttp_Click(object sender, EventArgs e)
{
SetListenerType(0);
SetListenerType(ListenerType.noHttpProxy);
}
private void menuGlobal_Click(object sender, EventArgs e)
{
SetListenerType(1);
SetListenerType(ListenerType.GlobalHttp);
}
private void menuGlobalPAC_Click(object sender, EventArgs e)
{
SetListenerType(2);
SetListenerType(ListenerType.GlobalPac);
}
private void menuKeep_Click(object sender, EventArgs e)
{
SetListenerType(3);
SetListenerType(ListenerType.HttpOpenAndClear);
}
private void menuKeepPAC_Click(object sender, EventArgs e)
{
SetListenerType(4);
SetListenerType(ListenerType.PacOpenAndClear);
}
private void menuKeepNothing_Click(object sender, EventArgs e)
{
SetListenerType(5);
SetListenerType(ListenerType.HttpOpenOnly);
}
private void menuKeepPACNothing_Click(object sender, EventArgs e)
{
SetListenerType(6);
SetListenerType(ListenerType.PacOpenOnly);
}
private void SetListenerType(int type)
private void SetListenerType(ListenerType type)
{
config.listenerType = type;
ChangePACButtonStatus(type);
}
private void ChangePACButtonStatus(int type)
private void ChangePACButtonStatus(ListenerType type)
{
if (type != 0)
if (type != ListenerType.noHttpProxy)
{
HttpProxyHandle.RestartHttpAgent(config, false);
}
@@ -1162,7 +1167,7 @@ namespace v2rayN.Forms
for (int k = 0; k < menuSysAgentMode.DropDownItems.Count; k++)
{
ToolStripMenuItem item = ((ToolStripMenuItem)menuSysAgentMode.DropDownItems[k]);
item.Checked = (type == k);
item.Checked = ((int)type == k);
}
ConfigHandler.SaveConfig(ref config, false);
@@ -1174,6 +1179,22 @@ namespace v2rayN.Forms
#region CheckUpdate
private void askToDownload(DownloadHandle downloadHandle, string url)
{
if (UI.ShowYesNo(string.Format(UIRes.I18N("DownloadYesNo"), url)) == DialogResult.Yes)
{
if (httpProxyTest() > 0)
{
int httpPort = config.GetLocalPort(Global.InboundHttp);
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort);
downloadHandle.DownloadFileAsync(url, webProxy, 60);
}
else
{
downloadHandle.DownloadFileAsync(url, null, 60);
}
}
}
private void tsbCheckUpdateN_Click(object sender, EventArgs e)
{
//System.Diagnostics.Process.Start(Global.UpdateUrl);
@@ -1190,15 +1211,7 @@ namespace v2rayN.Forms
string url = args.Msg;
this.Invoke((MethodInvoker)(delegate
{
if (UI.ShowYesNo(string.Format(UIRes.I18N("DownloadYesNo"), url)) == DialogResult.No)
{
return;
}
else
{
downloadHandle.DownloadFileAsync(url, null, -1);
}
askToDownload(downloadHandle, url);
}));
}
else
@@ -1215,7 +1228,7 @@ namespace v2rayN.Forms
try
{
string fileName = Utils.GetPath(downloadHandle.DownloadFileName);
Process process = Process.Start("v2rayUpgrade.exe", fileName);
Process process = Process.Start("v2rayUpgrade.exe", "\"" + fileName + "\"");
if (process.Id > 0)
{
menuExit_Click(null, null);
@@ -1237,7 +1250,7 @@ namespace v2rayN.Forms
};
}
AppendText(false, string.Format(UIRes.I18N("MsgStartUpdating"), "v2rayN"));
AppendText(false, string.Format(UIRes.I18N("MsgStartUpdating"), "v2rayN"));
downloadHandle.CheckUpdateAsync("v2rayN");
}
@@ -1256,15 +1269,7 @@ namespace v2rayN.Forms
string url = args.Msg;
this.Invoke((MethodInvoker)(delegate
{
if (UI.ShowYesNo(string.Format(UIRes.I18N("DownloadYesNo"), url)) == DialogResult.No)
{
return;
}
else
{
downloadHandle.DownloadFileAsync(url, null, -1);
}
askToDownload(downloadHandle, url);
}));
}
else
@@ -1310,7 +1315,7 @@ namespace v2rayN.Forms
};
}
AppendText(false, string.Format(UIRes.I18N("MsgStartUpdating"), "v2rayCore"));
AppendText(false, string.Format(UIRes.I18N("MsgStartUpdating"), "v2rayCore"));
downloadHandle.CheckUpdateAsync("Core");
}
@@ -1415,6 +1420,14 @@ namespace v2rayN.Forms
}
private void tsbSubUpdate_Click(object sender, EventArgs e)
{
UpdateSubscriptionProcess();
}
/// <summary>
/// the subscription update process
/// </summary>
private void UpdateSubscriptionProcess()
{
AppendText(false, UIRes.I18N("MsgUpdateSubscriptionStart"));
@@ -1495,7 +1508,7 @@ namespace v2rayN.Forms
private void SetCurrentLanguage(string value)
{
Utils.RegWriteValue(Global.MyRegPath, Global.MyRegKeyLanguage, value);
Application.Restart();
//Application.Restart();
}
@@ -1505,5 +1518,16 @@ namespace v2rayN.Forms
{
Process.Start(Global.v2rayWebsiteUrl);
}
private void tsbTestMe_Click(object sender, EventArgs e)
{
string result = httpProxyTest() + "ms";
AppendText(false, string.Format(UIRes.I18N("TestMeOutput"), result));
}
private int httpProxyTest()
{
SpeedtestHandler statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "", UpdateSpeedtestHandler);
return statistics.RunAvailabilityCheck();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -118,52 +118,11 @@
<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="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>301, 534</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 142</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器列表</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="lvServers.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="menuAddCustomServer.Size" type="System.Drawing.Size, System.Drawing">
<data name="menuAddVmessServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuAddCustomServer.Text" xml:space="preserve">
<value>添加自定义配置服务器</value>
</data>
<data name="menuAddServers.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuAddServers.Text" xml:space="preserve">
<value>从剪贴板导入批量URL (Ctrl+V)</value>
</data>
<data name="menuAddServers2.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuAddServers2.Text" xml:space="preserve">
<value>从剪贴板导入批量URL</value>
<data name="menuAddVmessServer.Text" xml:space="preserve">
<value>添加[VMess]服务器</value>
</data>
<data name="menuAddShadowsocksServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
@@ -177,17 +136,38 @@
<data name="menuAddSocksServer.Text" xml:space="preserve">
<value>添加[Socks]服务器</value>
</data>
<data name="menuAddVmessServer.Size" type="System.Drawing.Size, System.Drawing">
<data name="menuAddCustomServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuAddVmessServer.Text" xml:space="preserve">
<value>添加[VMess]服务器</value>
<data name="menuAddCustomServer.Text" xml:space="preserve">
<value>添加自定义配置服务器</value>
</data>
<data name="menuCopyPACUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<data name="menuAddServers.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuCopyPACUrl.Text" xml:space="preserve">
<value>复制本地PAC网址</value>
<data name="menuAddServers.Text" xml:space="preserve">
<value>从剪贴板导入批量URL (Ctrl+V)</value>
</data>
<data name="menuScanScreen.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuScanScreen.Text" xml:space="preserve">
<value>扫描屏幕上的二维码 (Ctrl+S)</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
</data>
<data name="menuRemoveServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuRemoveServer.Text" xml:space="preserve">
<value>移除所选服务器(多选) (Delete)</value>
</data>
<data name="menuRemoveDuplicateServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuRemoveDuplicateServer.Text" xml:space="preserve">
<value>移除重复的服务器</value>
</data>
<data name="menuCopyServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
@@ -195,11 +175,74 @@
<data name="menuCopyServer.Text" xml:space="preserve">
<value>克隆所选服务器</value>
</data>
<data name="menuExit.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<data name="menuSetDefaultServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuExit.Text" xml:space="preserve">
<value>退出</value>
<data name="menuSetDefaultServer.Text" xml:space="preserve">
<value>设为活动服务器 (Enter)</value>
</data>
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 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>300, 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>300, 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>300, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>下移至底 (B)</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="toolStripSeparator9.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
</data>
<data name="menuPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuPingServer.Text" xml:space="preserve">
<value>测试服务器延迟Ping(多选) (Ctrl+P)</value>
</data>
<data name="menuTcpingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuTcpingServer.Text" xml:space="preserve">
<value>测试服务器延迟Tcping(多选) (Ctrl+O)</value>
</data>
<data name="menuRealPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuRealPingServer.Text" xml:space="preserve">
<value>测试服务器真连接延迟(多选) (Ctrl+R)</value>
</data>
<data name="menuSpeedServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuSpeedServer.Text" xml:space="preserve">
<value>测试服务器速度(多选) (Ctrl+T)</value>
</data>
<data name="toolStripSeparator6.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
</data>
<data name="menuExport2ClientConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
@@ -225,6 +268,38 @@
<data name="menuExport2SubContent.Text" xml:space="preserve">
<value>批量导出订阅内容至剪贴板(多选)</value>
</data>
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 53</value>
</data>
<data name="tsbServer.Text" xml:space="preserve">
<value> 服务器 </value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>301, 534</value>
</data>
<data name="lvServers.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="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>关闭Http代理</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
@@ -243,95 +318,29 @@
<data name="menuKeep.Text" xml:space="preserve">
<value>仅开启Http代理,并清除系统代理</value>
</data>
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeepNothing.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>
</data>
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 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>
</data>
<data name="menuMoveBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>下移至底 (B)</value>
</data>
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuMoveDown.Text" xml:space="preserve">
<value>下移 (D)</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 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>300, 22</value>
</data>
<data name="menuMoveUp.Text" xml:space="preserve">
<value>上移 (U)</value>
</data>
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>关闭Http代理</value>
</data>
<data name="menuPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuPingServer.Text" xml:space="preserve">
<value>测试服务器延迟Ping(多选) (Ctrl+P)</value>
</data>
<data name="menuRealPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuRealPingServer.Text" xml:space="preserve">
<value>测试服务器真连接延迟(多选) (Ctrl+R)</value>
</data>
<data name="menuRemoveDuplicateServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuRemoveDuplicateServer.Text" xml:space="preserve">
<value>移除重复的服务器</value>
</data>
<data name="menuRemoveServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuRemoveServer.Text" xml:space="preserve">
<value>移除所选服务器(多选) (Delete)</value>
</data>
<data name="menuScanScreen.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuScanScreen.Text" xml:space="preserve">
<value>扫描屏幕上的二维码 (Ctrl+S)</value>
</data>
<data name="menuScanScreen2.Size" type="System.Drawing.Size, System.Drawing">
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuScanScreen2.Text" xml:space="preserve">
<value>扫描屏幕上的二维码</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http代理</value>
</data>
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
@@ -339,53 +348,124 @@
<data name="menuServers.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="menuSetDefaultServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuSetDefaultServer.Text" xml:space="preserve">
<value>设为活动服务器 (Enter)</value>
</data>
<data name="menuSpeedServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuSpeedServer.Text" xml:space="preserve">
<value>测试服务器速度(多选) (Ctrl+T)</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<data name="menuAddServers2.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http代理</value>
<data name="menuAddServers2.Text" xml:space="preserve">
<value>从剪贴板导入批量URL</value>
</data>
<data name="menuTcpingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
<data name="menuScanScreen2.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuTcpingServer.Text" xml:space="preserve">
<value>测试服务器延迟Tcping(多选) (Ctrl+O)</value>
<data name="menuScanScreen2.Text" xml:space="preserve">
<value>扫描屏幕上的二维码</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
<data name="menuCopyPACUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
<data name="menuCopyPACUrl.Text" xml:space="preserve">
<value>复制本地PAC网址</value>
</data>
<data name="toolStripSeparator13.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 6</value>
<data name="menuUpdateSubscriptions.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuUpdateSubscriptions.Text" xml:space="preserve">
<value>更新订阅</value>
</data>
<data name="toolStripSeparator2.Size" type="System.Drawing.Size, System.Drawing">
<value>192, 6</value>
</data>
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
<data name="menuExit.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="toolStripSeparator6.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
<data name="menuExit.Text" xml:space="preserve">
<value>退出</value>
</data>
<data name="toolStripSeparator9.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 164</value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>v2rayN 项目</value>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器列表</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 22</value>
</data>
<data name="tsbSubSetting.Text" xml:space="preserve">
<value>订阅设置</value>
</data>
<data name="tsbSubUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 22</value>
</data>
<data name="tsbSubUpdate.Text" xml:space="preserve">
<value>更新订阅</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
</data>
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 53</value>
</data>
<data name="tsbOptionSetting.Text" xml:space="preserve">
<value> 参数设置 </value>
</data>
<data name="tsbReload.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</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>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
NQwF4JkcFRWiUAB7IVW2FFPO3YqlgPd+LJf02e8Fdi3rMdIAcLDuf9UpeT0IS0G/hvhPm305vSl7EQFY
B6zCvozvYGzRM8zEoeg5TPZwDaGvpHQni1yzSxbXPW9q+hF13ROHuJnQcjbhtQAAAABJRU5ErkJggg==
</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>
</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>
</data>
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
<value>v2rayCore</value>
</data>
<data name="tsbCheckUpdatePACList.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 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>
@@ -399,23 +479,23 @@
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value> 检查更新 </value>
</data>
<data name="tsbCheckUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 22</value>
<data name="tsbAbout.Text" xml:space="preserve">
<value>v2rayN 项目</value>
</data>
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
<value>v2rayCore</value>
<data name="tsbV2rayWebsite.Text" xml:space="preserve">
<value>V2Ray 官网</value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 22</value>
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 53</value>
</data>
<data name="tsbCheckUpdateN.Text" xml:space="preserve">
<value>v2rayN</value>
<data name="tsbHelp.Text" xml:space="preserve">
<value> 帮助 </value>
</data>
<data name="tsbCheckUpdatePACList.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 22</value>
<data name="tsbPromotion.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 53</value>
</data>
<data name="tsbCheckUpdatePACList.Text" xml:space="preserve">
<value>PAC</value>
<data name="tsbPromotion.Text" xml:space="preserve">
<value> 推广 </value>
</data>
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@@ -430,66 +510,4 @@
<data name="tsbClose.Text" xml:space="preserve">
<value> 关闭窗口 </value>
</data>
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 53</value>
</data>
<data name="tsbHelp.Text" xml:space="preserve">
<value> 帮助 </value>
</data>
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 53</value>
</data>
<data name="tsbOptionSetting.Text" xml:space="preserve">
<value> 参数设置 </value>
</data>
<data name="tsbPromotion.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 53</value>
</data>
<data name="tsbPromotion.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>76, 53</value>
</data>
<data name="tsbReload.Text" xml:space="preserve">
<value> 重启服务 </value>
</data>
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 53</value>
</data>
<data name="tsbServer.Text" xml:space="preserve">
<value> 服务器 </value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
</data>
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 22</value>
</data>
<data name="tsbSubSetting.Text" xml:space="preserve">
<value>订阅设置</value>
</data>
<data name="tsbSubUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 22</value>
</data>
<data name="tsbSubUpdate.Text" xml:space="preserve">
<value>更新订阅</value>
</data>
<data name="tsbV2rayWebsite.Text" xml:space="preserve">
<value>V2Ray 官网</value>
</data>
</root>

View File

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

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Base;
using v2rayN.HttpProxyHandler;
namespace v2rayN.Forms
{
@@ -67,7 +68,7 @@ namespace v2rayN.Forms
//remoteDNS
txtremoteDNS.Text = config.remoteDNS;
cmblistenerType.SelectedIndex = config.listenerType;
cmblistenerType.SelectedIndex = (int)config.listenerType;
}
/// <summary>
@@ -262,7 +263,8 @@ namespace v2rayN.Forms
//remoteDNS
config.remoteDNS = txtremoteDNS.Text.TrimEx();
config.listenerType = cmblistenerType.SelectedIndex;
config.listenerType = (ListenerType)Enum.ToObject(typeof(ListenerType), cmblistenerType.SelectedIndex);
return 0;
}
@@ -435,6 +437,11 @@ namespace v2rayN.Forms
{
labRoutingTips.Text = text;
}
private void linkLabelRoutingDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://www.v2ray.com/chapter_02/03_routing.html#routingobject");
}
}
class ComboItem

View File

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

View File

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

View File

@@ -32,8 +32,8 @@ namespace v2rayN.Forms
txtUrl.Text = string.Empty;
return;
}
picQRCode.Image = QRCodeHelper.GetQRCode(url);
txtUrl.Text = url;
picQRCode.Image = QRCodeHelper.GetQRCode(url);
}
}

View File

@@ -16,6 +16,7 @@ namespace v2rayN
/// </summary>
public const string SpeedTestUrl = @"http://speedtest-sgp1.digitalocean.com/10mb.test";
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
public const string AvailabilityTestUrl = @"https://www.google.com/generate_204";
/// <summary>
/// CustomRoutingListUrl
@@ -27,7 +28,7 @@ namespace v2rayN
/// <summary>
/// PromotionUrl
/// </summary>
public const string PromotionUrl = @"aHR0cHM6Ly8xLjIzNDQ1Ni54eXovYWJjLmh0bWw=";
public const string PromotionUrl = @"aHR0cHM6Ly85LjIzNDQ1Ni54eXovYWJjLmh0bWw=";
/// <summary>
/// 本软件配置文件名

View File

@@ -140,6 +140,10 @@ namespace v2rayN.Handler
//{
// config.remoteDNS = "1.1.1.1";
//}
if (Utils.IsNullOrEmpty(config.defaultAllowInsecure))
{
config.defaultAllowInsecure = "false";
}
if (config.subItem == null)
{
@@ -193,6 +197,7 @@ namespace v2rayN.Handler
vmessItem.requestHost = vmessItem.requestHost.TrimEx();
vmessItem.path = vmessItem.path.TrimEx();
vmessItem.streamSecurity = vmessItem.streamSecurity.TrimEx();
vmessItem.allowInsecure = config.defaultAllowInsecure;
if (index >= 0)
{
@@ -276,18 +281,19 @@ namespace v2rayN.Handler
VmessItem vmessItem = new VmessItem
{
configVersion = config.vmess[index].configVersion,
configType = config.vmess[index].configType,
address = config.vmess[index].address,
port = config.vmess[index].port,
id = config.vmess[index].id,
alterId = config.vmess[index].alterId,
security = config.vmess[index].security,
network = config.vmess[index].network,
remarks = string.Format("{0}-clone", config.vmess[index].remarks),
headerType = config.vmess[index].headerType,
requestHost = config.vmess[index].requestHost,
path = config.vmess[index].path,
streamSecurity = config.vmess[index].streamSecurity,
remarks = string.Format("{0}-clone", config.vmess[index].remarks)
allowInsecure = config.vmess[index].allowInsecure,
configType = config.vmess[index].configType
};
config.vmess.Insert(index + 1, vmessItem); // 插入到下一项

View File

@@ -57,7 +57,7 @@ namespace v2rayN.Handler
private readonly string coreLatestUrl = "https://github.com/v2ray/v2ray-core/releases/latest";
private const string coreUrl = "https://github.com/v2ray/v2ray-core/releases/download/{0}/v2ray-windows-{1}.zip";
public async Task CheckUpdateAsync(string type)
public async void CheckUpdateAsync(string type)
{
Utils.SetSecurityProtocol();
WebRequestHandler webRequestHandler = new WebRequestHandler

View File

@@ -32,7 +32,7 @@ namespace v2rayN.Handler
try
{
Color color = ColorTranslator.FromHtml("#3399CC");
int index = config.listenerType;
int index = (int)config.listenerType;
if (index > 0)
{
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange, Color.DarkSlateBlue, Color.RoyalBlue })[index - 1];

View File

@@ -109,17 +109,14 @@ namespace v2rayN.Handler
//Thread.Sleep(5000);
int httpPort = _config.GetLocalPort("speedtest");
Task[] tasks = new Task[_selecteds.Count];
int i = -1;
List<Task> tasks = new List<Task>();
foreach (int itemIndex in _selecteds)
{
if (_config.vmess[itemIndex].configType == (int)EConfigType.Custom)
{
continue;
}
i++;
tasks[i] = Task.Run(() =>
tasks.Add(Task.Run(() =>
{
try
{
@@ -133,12 +130,10 @@ namespace v2rayN.Handler
{
Utils.SaveLog(ex.Message, ex);
}
});
}));
//Thread.Sleep(100);
}
Task.WaitAll(tasks);
Thread.Sleep(100);
Task.WaitAll(tasks.ToArray());
}
catch (Exception ex)
{
@@ -150,6 +145,37 @@ namespace v2rayN.Handler
}
}
public int RunAvailabilityCheck() // alias: isLive
{
try
{
int httpPort = _config.GetLocalPort(Global.InboundHttp);
Task<int> t = Task.Run(() =>
{
try
{
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort);
int responseTime = -1;
string status = GetRealPingTime(Global.AvailabilityTestUrl, webProxy, out responseTime);
bool noError = Utils.IsNullOrEmpty(status);
return noError ? responseTime : -1;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return -1;
}
});
return t.Result;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return -1;
}
}
private void RunSpeedTest()
{
int pid = -1;

View File

@@ -69,7 +69,7 @@ namespace v2rayN.Handler
}
else
{
ShowMsg(true, msg);
ShowMsg(false, msg);
pid = V2rayStartNew(configStr);
//V2rayRestart();
// start with -config
@@ -175,7 +175,7 @@ namespace v2rayN.Handler
if (Utils.IsNullOrEmpty(fileName))
{
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2ray/v2ray-core/releases");
ShowMsg(true, msg);
ShowMsg(false, msg);
}
return fileName;
}
@@ -200,6 +200,7 @@ namespace v2rayN.Handler
WorkingDirectory = Utils.StartupPath(),
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
StandardOutputEncoding = Encoding.UTF8
}
@@ -213,10 +214,16 @@ namespace v2rayN.Handler
}
});
p.Start();
p.PriorityClass = ProcessPriorityClass.High;
p.BeginOutputReadLine();
//processId = p.Id;
_process = p;
if (p.WaitForExit(1000))
{
throw new Exception(p.StandardError.ReadToEnd());
}
Global.processJob.AddProcess(p.Handle);
}
catch (Exception ex)
@@ -248,6 +255,7 @@ namespace v2rayN.Handler
UseShellExecute = false,
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
StandardOutputEncoding = Encoding.UTF8
}
@@ -266,6 +274,11 @@ namespace v2rayN.Handler
p.StandardInput.Write(configStr);
p.StandardInput.Close();
if (p.WaitForExit(1000))
{
throw new Exception(p.StandardError.ReadToEnd());
}
Global.processJob.AddProcess(p.Handle);
return p.Id;
}
@@ -273,7 +286,7 @@ namespace v2rayN.Handler
{
Utils.SaveLog(ex.Message, ex);
string msg = ex.Message;
ShowMsg(true, msg);
ShowMsg(false, msg);
return -1;
}
}

View File

@@ -3,6 +3,19 @@ using v2rayN.Mode;
namespace v2rayN.HttpProxyHandler
{
/// <summary>
/// 系统代理(http)模式
/// </summary>
public enum ListenerType
{
noHttpProxy = 0,
GlobalHttp = 1,
GlobalPac = 2,
HttpOpenAndClear = 3,
PacOpenAndClear = 4,
HttpOpenOnly = 5,
PacOpenOnly = 6
}
/// <summary>
/// 系统代理(http)总处理
/// 启动privoxy提供http协议
@@ -12,29 +25,29 @@ namespace v2rayN.HttpProxyHandler
{
private static bool Update(Config config, bool forceDisable)
{
int type = config.listenerType;
ListenerType type = config.listenerType;
if (forceDisable)
{
type = 0;
type = ListenerType.noHttpProxy;
}
try
{
if (type != 0)
if (type != ListenerType.noHttpProxy)
{
int port = Global.httpPort;
if (port <= 0)
{
return false;
}
if (type == 1)
if (type == ListenerType.GlobalHttp)
{
//PACServerHandle.Stop();
//ProxySetting.SetProxy($"{Global.Loopback}:{port}", Global.IEProxyExceptions, 2);
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}");
}
else if (type == 2)
else if (type == ListenerType.GlobalPac)
{
string pacUrl = GetPacUrl();
//ProxySetting.SetProxy(pacUrl, "", 4);
@@ -42,24 +55,24 @@ namespace v2rayN.HttpProxyHandler
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
else if (type == 3)
else if (type == ListenerType.HttpOpenAndClear)
{
//PACServerHandle.Stop();
SysProxyHandle.ResetIEProxy();
}
else if (type == 4)
else if (type == ListenerType.PacOpenAndClear)
{
string pacUrl = GetPacUrl();
SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
else if (type == 5)
else if (type == ListenerType.HttpOpenOnly)
{
//PACServerHandle.Stop();
//SysProxyHandle.ResetIEProxy();
}
else if (type == 6)
else if (type == ListenerType.PacOpenOnly)
{
string pacUrl = GetPacUrl();
//SysProxyHandle.ResetIEProxy();
@@ -114,7 +127,7 @@ namespace v2rayN.HttpProxyHandler
{
try
{
if (config.listenerType != 5 && config.listenerType != 6)
if (config.listenerType != ListenerType.HttpOpenOnly && config.listenerType != ListenerType.PacOpenOnly)
{
Update(config, true);
}
@@ -138,7 +151,7 @@ namespace v2rayN.HttpProxyHandler
public static void RestartHttpAgent(Config config, bool forced)
{
bool isRestart = false;
if (config.listenerType == 0)
if (config.listenerType == ListenerType.noHttpProxy)
{
// 关闭http proxy时直接返回
return;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using v2rayN.Base;
using v2rayN.HttpProxyHandler;
namespace v2rayN.Mode
{
@@ -107,9 +109,9 @@ namespace v2rayN.Mode
}
/// <summary>
/// 监听状态 0-not 1-http 2-PAC
/// 监听状态
/// </summary>
public int listenerType
public ListenerType listenerType
{
get; set;
}
@@ -176,6 +178,15 @@ namespace v2rayN.Mode
{
get; set;
}
/// <summary>
/// 是否允许不安全连接
/// </summary>
public string defaultAllowInsecure
{
get; set;
}
/// <summary>
/// 订阅
/// </summary>

View File

@@ -33,11 +33,6 @@ namespace v2rayN
if (!IsDuplicateInstance())
{
if (!UnzipLibs())
{
UI.ShowError($"Error preparing the environment(准备运行环境出错)");
return;
}
Utils.SaveLog("v2rayN start up " + Utils.GetVersion());
@@ -100,21 +95,5 @@ namespace v2rayN
{
Utils.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject);
}
static bool UnzipLibs()
{
string fileName = Utils.GetPath("libs.zip");
if (!FileManager.ByteArrayToFile(fileName, Resources.libs))
{
return false;
}
if (!FileManager.ZipExtractToFile(fileName))
{
return false;
}
return true;
}
}
}

View File

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

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 {
@@ -100,16 +100,6 @@ namespace v2rayN.Properties {
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] libs {
get {
object obj = ResourceManager.GetObject("libs", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>

View File

@@ -130,9 +130,6 @@
<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="libs" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\lib\libs.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</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>

View File

@@ -780,5 +780,14 @@ namespace v2rayN.Resx {
return ResourceManager.GetString("SuccessfullyImportedServerViaScan", resourceCulture);
}
}
/// <summary>
/// 查找类似 The ping of current service: {0} 的本地化字符串。
/// </summary>
internal static string TestMeOutput {
get {
return ResourceManager.GetString("TestMeOutput", resourceCulture);
}
}
}
}

View File

@@ -264,12 +264,12 @@
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
<value>Start getting subscriptions</value>
</data>
<data name="MsgStartUpdatingPAC" xml:space="preserve">
<value>Start updating PAC...</value>
</data>
<data name="MsgStartUpdating" xml:space="preserve">
<value>Start updating {0}...</value>
</data>
<data name="MsgStartUpdatingPAC" xml:space="preserve">
<value>Start updating PAC...</value>
</data>
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
<value>Subscription content decoding failed (non-BASE64 code)</value>
</data>
@@ -358,4 +358,7 @@
<data name="SuccessfullyImportedServerViaScan" xml:space="preserve">
<value>Scan import URL successfully</value>
</data>
<data name="TestMeOutput" xml:space="preserve">
<value>The ping of current service: {0}</value>
</data>
</root>

View File

@@ -264,12 +264,12 @@
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
<value>开始获取订阅内容</value>
</data>
<data name="MsgStartUpdatingPAC" xml:space="preserve">
<value>开始更新 PAC...</value>
</data>
<data name="MsgStartUpdating" xml:space="preserve">
<value>开始更新 {0}...</value>
</data>
<data name="MsgStartUpdatingPAC" xml:space="preserve">
<value>开始更新 PAC...</value>
</data>
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
<value>订阅内容解码失败(非BASE64码)</value>
</data>
@@ -358,4 +358,7 @@
<data name="SuccessfullyImportedServerViaScan" xml:space="preserve">
<value>扫描导入URL成功</value>
</data>
<data name="TestMeOutput" xml:space="preserve">
<value>当前服务的真连接延迟: {0}</value>
</data>
</root>

View File

@@ -804,21 +804,14 @@ namespace v2rayN
public static string UnGzip(byte[] buf)
{
byte[] buffer = new byte[1024];
int n;
using (MemoryStream sb = new MemoryStream())
MemoryStream sb = new MemoryStream();
using (GZipStream input = new GZipStream(new MemoryStream(buf),
CompressionMode.Decompress,
false))
{
using (GZipStream input = new GZipStream(new MemoryStream(buf),
CompressionMode.Decompress,
false))
{
while ((n = input.Read(buffer, 0, buffer.Length)) > 0)
{
sb.Write(buffer, 0, n);
}
}
return Encoding.UTF8.GetString(sb.ToArray());
input.CopyTo(sb);
}
return Encoding.UTF8.GetString(sb.ToArray());
}
#endregion

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Grpc.Tools" version="2.24.0" targetFramework="net46" developmentDependency="true" />
</packages>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.props" Condition="Exists('..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -45,7 +44,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
@@ -74,33 +73,14 @@
</PropertyGroup>
<PropertyGroup />
<PropertyGroup />
<PropertyGroup>
<StartupObject>v2rayN.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="Google.Protobuf, Version=3.9.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\Google.Protobuf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Grpc.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\Grpc.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Grpc.Core.Api, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\Grpc.Core.Api.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\System.Buffers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -109,32 +89,12 @@
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\System.Memory.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Messaging" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="zxing, Version=0.16.2.0, Culture=neutral, PublicKeyToken=4e88037ac681fe60, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\zxing.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="zxing.presentation, Version=0.16.2.0, Culture=neutral, PublicKeyToken=4e88037ac681fe60, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\zxing.presentation.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Forms\AddServer4Form.cs">
@@ -332,8 +292,6 @@
<EmbeddedResource Include="app.config">
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="LIB\libs.zip" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -416,36 +374,37 @@
<None Include="Resources\sub.png" />
<None Include="Resources\checkupdate.png" />
<None Include="Resources\about.png" />
<None Include="LIB\Google.Protobuf.dll" />
<None Include="LIB\Grpc.Core.Api.dll" />
<None Include="LIB\Grpc.Core.dll" />
<None Include="LIB\Newtonsoft.Json.dll" />
<None Include="LIB\System.Buffers.dll" />
<None Include="LIB\System.Memory.dll" />
<None Include="LIB\System.Runtime.CompilerServices.Unsafe.dll" />
<None Include="LIB\zxing.dll" />
<None Include="LIB\zxing.presentation.dll" />
<None Include="LIB\netstandard.dll" />
<Content Include="LIB\grpc_csharp_ext.x64.dll" />
<Content Include="LIB\grpc_csharp_ext.x86.dll" />
<Content Include="Resources\help.png" />
<None Include="Resources\notify.png" />
<Content Include="Resources\privoxy_conf.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf">
<Version>3.11.4</Version>
</PackageReference>
<PackageReference Include="Grpc.Core">
<Version>2.27.0</Version>
</PackageReference>
<PackageReference Include="Grpc.Tools">
<Version>2.27.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
</PackageReference>
<PackageReference Include="ZXing.Net">
<Version>0.16.5</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
<PostBuildEvent>copy /y $(SolutionDir)v2rayUpgrade\$(OutDir)* $(TargetDir)
del $(TargetDir)*.xml $(TargetDir)*.so $(TargetDir)*.dylib
if not "$(ConfigurationName)" == "Debug" del $(TargetDir)*.pdb</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.props'))" />
<Error Condition="!Exists('..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.targets'))" />
</Target>
<Import Project="..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.targets" Condition="Exists('..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Windows.Forms;
namespace v2rayUpgrade
@@ -41,13 +42,14 @@ namespace v2rayUpgrade
}
catch (Exception ex)
{
showWarn("Failed to close v2rayN(关闭v2rayN失败)." + ex.StackTrace);
return;
// Access may be denied without admin right. The user may not be an administrator.
showWarn("Failed to close v2rayN(关闭v2rayN失败).\n" +
"Close it manually, or the upgrade may fail.(请手动关闭正在运行的v2rayN否则可能升级失败。\n\n" + ex.StackTrace);
}
StringBuilder sb = new StringBuilder();
try
{
if (!File.Exists(fileName))
{
if (File.Exists(defaultFilename))
@@ -61,27 +63,41 @@ namespace v2rayUpgrade
}
}
string thisAppOldFile = Application.ExecutablePath + ".tmp";
File.Delete(thisAppOldFile);
string startKey = "v2rayN/";
using (ZipArchive archive = ZipFile.OpenRead(fileName))
{
foreach (ZipArchiveEntry entry in archive.Entries)
{
if (entry.Length == 0)
try
{
continue;
if (entry.Length == 0)
{
continue;
}
string fullName = entry.FullName;
if (fullName.StartsWith(startKey))
{
fullName = fullName.Substring(startKey.Length, fullName.Length - startKey.Length);
}
if (Application.ExecutablePath.ToLower() == GetPath(fullName).ToLower())
{
File.Move(Application.ExecutablePath, thisAppOldFile);
}
string entryOuputPath = GetPath(fullName);
FileInfo fileInfo = new FileInfo(entryOuputPath);
fileInfo.Directory.Create();
entry.ExtractToFile(entryOuputPath, true);
}
string fullName = entry.FullName;
if (fullName.StartsWith(startKey))
catch (Exception ex)
{
fullName = fullName.Substring(startKey.Length, fullName.Length - startKey.Length);
sb.Append(ex.StackTrace);
}
string entryOuputPath = GetPath(fullName);
FileInfo fileInfo = new FileInfo(entryOuputPath);
fileInfo.Directory.Create();
entry.ExtractToFile(entryOuputPath, true);
}
}
}
@@ -90,6 +106,12 @@ namespace v2rayUpgrade
showWarn("Upgrade Failed(升级失败)." + ex.StackTrace);
return;
}
if (sb.Length > 0)
{
showWarn("Upgrade Failed,Hold ctrl + c to copy to clipboard.\n" +
"(升级失败,按住ctrl+c可以复制到剪贴板)." + sb.ToString());
return;
}
Process.Start("v2rayN.exe");
MessageBox.Show("Upgrade successed(升级成功)", "", MessageBoxButtons.OK, MessageBoxIcon.Information);

View File

@@ -27,7 +27,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>