You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace WPFupdate
{
internal class WPFupdate1
{
public static void Main(string[] args)
{
Console.WriteLine(args[0]);
Thread.Sleep(1500);
// 设置要启动的应用程序名称和参数
string appName = args[0];//"XGLFinishPro.exe"; // 替换为你的目标控制台应用程序的名称
string appArguments = " ";// 替换为你的应用程序需要的参数
Console.WriteLine(appName);
// 创建进程启动信息
ProcessStartInfo startInfo = new ProcessStartInfo
{
FileName = appName,
Arguments = appArguments,
RedirectStandardOutput = false, // 可以选择是否重定向标准输出
UseShellExecute = false, // 必须设置为false以便在控制台中启动应用程序
CreateNoWindow = false // 设置为true以便在后台启动应用程序
};
// 创建并启动进程
Process process = new Process
{
StartInfo = startInfo
};
process.Start();
Environment.Exit(0);
Console.ReadLine();
// 在这里添加你的应用程序的主要逻辑
}
}
}