WPF程序接收启动参数并启动

新建一个WPF项目WpfApp1

 创建一个新的启动类

public class NewApp
{
public static string[] Args = new string[] { };
[STAThread]
public static void Main(string[] args)
{
Args = args;
App app = new App();
app.InitializeComponent();
app.Run();

}
}

然后修改启动对象

 接收启动参数

 

 使用命令行进行启动

 成功接受到启动参数

 

posted @ 2023-04-27 16:30  奇迹之耀  阅读(296)  评论(0编辑  收藏  举报