mirror of
https://github.com/zs-yg/MCSJ.git
synced 2025-12-06 10:50:42 +08:00
解决警告问题
This commit is contained in:
@@ -51,15 +51,19 @@ namespace MCSJ.Tools.ServerManagement
|
||||
|
||||
// 解析JRE配置
|
||||
var jreVersions = new Dictionary<string, Dictionary<string, string>>();
|
||||
string currentVersion = null;
|
||||
string currentVersion = string.Empty;
|
||||
|
||||
foreach (var line in File.ReadAllLines(jreConfigPath))
|
||||
{
|
||||
if (line.StartsWith("[") && line.EndsWith("]"))
|
||||
{
|
||||
currentVersion = line.Trim('[', ']');
|
||||
var version = line.Trim('[', ']');
|
||||
currentVersion = version ?? string.Empty;
|
||||
if (currentVersion != null!)
|
||||
{
|
||||
jreVersions[currentVersion] = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
else if (line.Contains("=") && currentVersion != null)
|
||||
{
|
||||
var parts = line.Split('=');
|
||||
|
||||
Reference in New Issue
Block a user