23 lines
648 B
C#
23 lines
648 B
C#
// See https://aka.ms/new-console-template for more information
|
||
using System.Diagnostics;
|
||
|
||
string currentDir = Directory.GetCurrentDirectory();
|
||
DirectoryInfo dirInfo = new DirectoryInfo(currentDir);
|
||
|
||
foreach (var subdir in dirInfo.GetDirectories())
|
||
{
|
||
FileInfo[] files = subdir.GetFiles();
|
||
|
||
foreach (FileInfo file in files)
|
||
{
|
||
if (file.Name == "Start.exe")
|
||
{
|
||
string startPath = Path.Combine(subdir.FullName, "Start.exe");
|
||
Process.Start(startPath);
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
|
||
Console.WriteLine("当前目录子文件中未找到Start.exe,程序即将退出...");
|
||
Console.ReadLine(); |