diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index 9c1d4517..9f988b60 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -960,7 +960,7 @@ namespace v2rayN.Forms private void notifyMain_MouseClick(object sender, MouseEventArgs e) { - if (e.Button == System.Windows.Forms.MouseButtons.Left) + if (e.Button == MouseButtons.Left) { ShowForm(); } @@ -1370,12 +1370,12 @@ namespace v2rayN.Forms private void tsbAbout_Click(object sender, EventArgs e) { - System.Diagnostics.Process.Start(Global.AboutUrl); + Process.Start(Global.AboutUrl); } private void tsbPromotion_Click(object sender, EventArgs e) { - System.Diagnostics.Process.Start($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}"); + Process.Start($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}"); } #endregion @@ -1507,7 +1507,7 @@ namespace v2rayN.Forms private void tsbV2rayWebsite_Click(object sender, EventArgs e) { - System.Diagnostics.Process.Start(Global.v2rayWebsiteUrl); + Process.Start(Global.v2rayWebsiteUrl); } } } diff --git a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs index b8e43bc9..5d437869 100644 --- a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs +++ b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs @@ -221,7 +221,7 @@ namespace v2rayN.Handler try { - if (!System.Net.IPAddress.TryParse(url, out IPAddress ipAddress)) + if (!IPAddress.TryParse(url, out IPAddress ipAddress)) { IPHostEntry ipHostInfo = System.Net.Dns.GetHostEntry(url); ipAddress = ipHostInfo.AddressList[0]; diff --git a/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs b/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs index 254bf115..2ee71072 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs @@ -128,7 +128,7 @@ namespace v2rayN.HttpProxyHandler public InternetConnectionOptionValue m_Value; static InternetConnectionOption() { - InternetConnectionOption.Size = Marshal.SizeOf(typeof(InternetConnectionOption)); + Size = Marshal.SizeOf(typeof(InternetConnectionOption)); } // Nested Types diff --git a/v2rayN/v2rayN/Program.cs b/v2rayN/v2rayN/Program.cs index 3d57be50..bd6e36d3 100644 --- a/v2rayN/v2rayN/Program.cs +++ b/v2rayN/v2rayN/Program.cs @@ -46,7 +46,7 @@ namespace v2rayN //设置语言环境 string lang = Utils.RegReadValue(Global.MyRegPath, Global.MyRegKeyLanguage, "zh-Hans"); - System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); + Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index bbca80c8..f6f0bb3c 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/v2rayN/v2rayN/Tool/Utils.cs @@ -124,7 +124,7 @@ namespace v2rayN int result = -1; try { - using (StreamWriter file = System.IO.File.CreateText(filePath)) + using (StreamWriter file = File.CreateText(filePath)) { //JsonSerializer serializer = new JsonSerializer(); JsonSerializer serializer = new JsonSerializer() { Formatting = Formatting.Indented }; @@ -194,7 +194,7 @@ namespace v2rayN { try { - byte[] plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); + byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); return Convert.ToBase64String(plainTextBytes); } catch (Exception ex) @@ -364,7 +364,7 @@ namespace v2rayN { try { - int var1 = Utils.ToInt(oText); + int var1 = ToInt(oText); return true; } catch @@ -533,7 +533,7 @@ namespace v2rayN public static string GetPath(string fileName) { string startupPath = StartupPath(); - if (Utils.IsNullOrEmpty(fileName)) + if (IsNullOrEmpty(fileName)) { return startupPath; } @@ -833,7 +833,7 @@ namespace v2rayN sb.Write(buffer, 0, n); } } - return System.Text.Encoding.UTF8.GetString(sb.ToArray()); + return Encoding.UTF8.GetString(sb.ToArray()); } }