Compare commits

..

3 Commits
4.35 ... 4.36

Author SHA1 Message Date
2dust
887dd8da3b Update AssemblyInfo.cs 2022-03-08 18:29:04 +08:00
2dust
731db2541d load core async, remove Ssl3 2022-03-08 18:28:39 +08:00
2dust
bfdc0a2e77 Update MainForm.cs 2022-03-06 20:24:35 +08:00
3 changed files with 13 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
@@ -131,6 +132,7 @@ namespace v2rayN.Forms
SysProxyHandle.UpdateSysProxy(config, true); SysProxyHandle.UpdateSysProxy(config, true);
} }
StorageUI();
ConfigHandler.SaveConfig(ref config); ConfigHandler.SaveConfig(ref config);
statistics?.SaveToFile(); statistics?.SaveToFile();
statistics?.Close(); statistics?.Close();
@@ -170,7 +172,7 @@ namespace v2rayN.Forms
switch (Utils.ToInt(e.Name)) switch (Utils.ToInt(e.Name))
{ {
case (int)EGlobalHotkey.ShowForm: case (int)EGlobalHotkey.ShowForm:
ShowForm(); if (this.ShowInTaskbar) HideForm(); else ShowForm();
break; break;
case (int)EGlobalHotkey.SystemProxyClear: case (int)EGlobalHotkey.SystemProxyClear:
SetListenerType(ESysProxyType.ForcedClear); SetListenerType(ESysProxyType.ForcedClear);
@@ -462,7 +464,7 @@ namespace v2rayN.Forms
/// <summary> /// <summary>
/// 载入V2ray /// 载入V2ray
/// </summary> /// </summary>
private void LoadV2ray() async Task LoadV2ray()
{ {
tsbReload.Enabled = false; tsbReload.Enabled = false;
@@ -470,7 +472,11 @@ namespace v2rayN.Forms
{ {
ClearMsg(); ClearMsg();
} }
await Task.Run(() =>
{
v2rayHandler.LoadV2ray(config); v2rayHandler.LoadV2ray(config);
});
Global.reloadV2ray = false; Global.reloadV2ray = false;
ConfigHandler.SaveConfig(ref config, false); ConfigHandler.SaveConfig(ref config, false);
statistics?.SaveToFile(); statistics?.SaveToFile();
@@ -834,6 +840,7 @@ namespace v2rayN.Forms
private void tsbClose_Click(object sender, EventArgs e) private void tsbClose_Click(object sender, EventArgs e)
{ {
StorageUI();
HideForm(); HideForm();
//this.WindowState = FormWindowState.Minimized; //this.WindowState = FormWindowState.Minimized;
} }

View File

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

View File

@@ -719,16 +719,14 @@ namespace v2rayN
{ {
if (enableSecurityProtocolTls13) if (enableSecurityProtocolTls13)
{ {
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls
| SecurityProtocolType.Tls11 | SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12 | SecurityProtocolType.Tls12
| SecurityProtocolType.Tls13; | SecurityProtocolType.Tls13;
} }
else else
{ {
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls
| SecurityProtocolType.Tls11 | SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12; | SecurityProtocolType.Tls12;
} }