From 5a32892e94e4a9ec8a7fd63f8af089582aff356e Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 20 Mar 2023 14:03:50 +0800 Subject: [PATCH] bug fixes --- v2rayN/v2rayN/Tool/Utils.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index 9c043931..76465b86 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/v2rayN/v2rayN/Tool/Utils.cs @@ -282,6 +282,8 @@ namespace v2rayN .Replace(Environment.NewLine, "") .Replace("\n", "") .Replace("\r", "") + .Replace('_', '/') + .Replace('-', '+') .Replace(" ", ""); if (plainText.Length % 4 > 0) @@ -312,7 +314,7 @@ namespace v2rayN } catch (Exception ex) { - SaveLog(ex.Message, ex); + //SaveLog(ex.Message, ex); return 0; } } @@ -324,7 +326,7 @@ namespace v2rayN } catch (Exception ex) { - SaveLog(ex.Message, ex); + //SaveLog(ex.Message, ex); return false; } } @@ -337,7 +339,7 @@ namespace v2rayN } catch (Exception ex) { - SaveLog(ex.Message, ex); + //SaveLog(ex.Message, ex); return string.Empty; } } @@ -865,7 +867,7 @@ namespace v2rayN string location = GetExePath(); if (blFull) { - return string.Format("v2rayN - V{0} - {1}", + return string.Format("v2rayN - V{0} - {1}-Test", FileVersionInfo.GetVersionInfo(location).FileVersion.ToString(), File.GetLastWriteTime(location).ToString("yyyy/MM/dd")); } @@ -907,13 +909,13 @@ namespace v2rayN /// public static string? GetClipboardData() { - string strData = string.Empty; + string? strData = string.Empty; try { IDataObject data = Clipboard.GetDataObject(); if (data.GetDataPresent(DataFormats.UnicodeText)) { - strData = data.GetData(DataFormats.UnicodeText).ToString(); + strData = data.GetData(DataFormats.UnicodeText)?.ToString(); } return strData; }