添加一键下载jre的功能

This commit is contained in:
zs-yg
2025-11-16 18:26:18 +08:00
parent ddc6aa4e95
commit 5acb70c5d2
6 changed files with 293 additions and 7 deletions

View File

@@ -71,6 +71,13 @@ namespace MCSJ.Tools
public void DisplayAllVersions()
{
var filePath = Path.Combine("resources", "serverlist.txt");
if (!File.Exists(filePath))
{
Console.WriteLine("版本列表文件不存在");
return;
}
Console.WriteLine("可用版本列表:");
foreach (var version in _versions.Keys)
{
@@ -78,7 +85,7 @@ namespace MCSJ.Tools
}
}
public string GetDownloadUrl(string version)
public string? GetDownloadUrl(string version)
{
return _versions.TryGetValue(version, out var url) ? url : null;
}