From 38ae66907096e65a485ab485379f966c76151d74 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Fri, 21 Apr 2023 14:49:33 +0800 Subject: [PATCH] bug fixes for ErrorDataReceived --- v2rayN/v2rayN/Handler/CoreHandler.cs | 18 ++++++++++++++++++ v2rayN/v2rayN/Resx/ResUI.Designer.cs | 8 ++++---- v2rayN/v2rayN/Resx/ResUI.resx | 8 ++++---- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/v2rayN/v2rayN/Handler/CoreHandler.cs b/v2rayN/v2rayN/Handler/CoreHandler.cs index a7091040..182e9491 100644 --- a/v2rayN/v2rayN/Handler/CoreHandler.cs +++ b/v2rayN/v2rayN/Handler/CoreHandler.cs @@ -189,6 +189,14 @@ namespace v2rayN.Handler if (displayLog) { p.OutputDataReceived += (sender, e) => + { + if (!string.IsNullOrEmpty(e.Data)) + { + string msg = e.Data + Environment.NewLine; + ShowMsg(false, msg); + } + }; + p.ErrorDataReceived += (sender, e) => { if (!string.IsNullOrEmpty(e.Data)) { @@ -201,6 +209,7 @@ namespace v2rayN.Handler if (displayLog) { p.BeginOutputReadLine(); + p.BeginErrorReadLine(); } _process = p; @@ -254,8 +263,17 @@ namespace v2rayN.Handler ShowMsg(false, msg); } }; + p.ErrorDataReceived += (sender, e) => + { + if (!string.IsNullOrEmpty(e.Data)) + { + string msg = e.Data + Environment.NewLine; + ShowMsg(false, msg); + } + }; p.Start(); p.BeginOutputReadLine(); + p.BeginErrorReadLine(); p.StandardInput.Write(configStr); p.StandardInput.Close(); diff --git a/v2rayN/v2rayN/Resx/ResUI.Designer.cs b/v2rayN/v2rayN/Resx/ResUI.Designer.cs index ccec13fb..d4c1acf9 100644 --- a/v2rayN/v2rayN/Resx/ResUI.Designer.cs +++ b/v2rayN/v2rayN/Resx/ResUI.Designer.cs @@ -1060,7 +1060,7 @@ namespace v2rayN.Resx { } /// - /// 查找类似 Rule Setting 的本地化字符串。 + /// 查找类似 Rule Settings 的本地化字符串。 /// public static string menuRoutingRuleSetting { get { @@ -1141,7 +1141,7 @@ namespace v2rayN.Resx { } /// - /// 查找类似 Setting 的本地化字符串。 + /// 查找类似 Settings 的本地化字符串。 /// public static string menuSetting { get { @@ -1231,7 +1231,7 @@ namespace v2rayN.Resx { } /// - /// 查找类似 Subscription group Setting 的本地化字符串。 + /// 查找类似 Subscription group Settings 的本地化字符串。 /// public static string menuSubSetting { get { @@ -2006,7 +2006,7 @@ namespace v2rayN.Resx { } /// - /// 查找类似 GlobalHotkey Setting 的本地化字符串。 + /// 查找类似 GlobalHotkey Settings 的本地化字符串。 /// public static string TbGlobalHotkeySetting { get { diff --git a/v2rayN/v2rayN/Resx/ResUI.resx b/v2rayN/v2rayN/Resx/ResUI.resx index c31763b6..23bcb084 100644 --- a/v2rayN/v2rayN/Resx/ResUI.resx +++ b/v2rayN/v2rayN/Resx/ResUI.resx @@ -467,7 +467,7 @@ Servers - Setting + Settings Update current subscription without proxy @@ -479,7 +479,7 @@ Subscription group - Subscription group Setting + Subscription group Settings Update subscription without proxy @@ -827,7 +827,7 @@ Display GUI - GlobalHotkey Setting + GlobalHotkey Settings Set directly by pressing the keyboard, Take effect after restart @@ -929,7 +929,7 @@ Import Rules From Sub Url - Rule Setting + Rule Settings Rule Add