修改
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationIcon>open-box.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="open-box.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,23 @@
|
||||
// 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();
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user