diff --git a/PCL.Core/App/PromoteService.cs b/PCL.Core/App/PromoteService.cs index 4bdbdb3e8..da1cfeab6 100644 --- a/PCL.Core/App/PromoteService.cs +++ b/PCL.Core/App/PromoteService.cs @@ -288,8 +288,8 @@ public static bool AppendAndActivate(string command, Action? callback = public override void Start() { - var args = Environment.GetCommandLineArgs(); - if (args is [_, "promote", _]) + var args = Basics.CommandLineArguments; + if (args is ["promote", _]) { Context.Info("当前进程为提权进程"); IsCurrentProcessPromoted = true; diff --git a/Plain Craft Launcher 2/Application.xaml.vb b/Plain Craft Launcher 2/Application.xaml.vb index 3fc696d4f..d6b9f0c20 100644 --- a/Plain Craft Launcher 2/Application.xaml.vb +++ b/Plain Craft Launcher 2/Application.xaml.vb @@ -32,7 +32,7 @@ Public Class Application PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Error SecretOnApplicationStart() '检查参数调用 - Dim args = Environment.GetCommandLineArgs.Skip(1).ToArray() + Dim args = Basics.CommandLineArguments If args.Length > 0 Then If args(0) = "--gpu" Then '调整显卡设置 diff --git a/Plain Craft Launcher 2/Program.vb b/Plain Craft Launcher 2/Program.vb index f8a6aab19..21e7ec1fe 100644 --- a/Plain Craft Launcher 2/Program.vb +++ b/Plain Craft Launcher 2/Program.vb @@ -8,7 +8,7 @@ Module Program Public Sub Main() #If DEBUG - If Environment.GetCommandLineArgs().Contains("--debug") Then + If Basics.CommandLineArguments.Contains("--debug") Then While Not Debugger.IsAttached Thread.Sleep(50) End While