配置读取问题
This commit is contained in:
@@ -113,19 +113,26 @@ namespace AibisDream.Utility
|
||||
/// <returns>已改为json的文件名</returns>
|
||||
public static string FormatAsJsonPath(string fileName)
|
||||
{
|
||||
// 找到最后一个点的位置
|
||||
int lastDotIndex = fileName.LastIndexOf('.');
|
||||
// // 找到最后一个点的位置
|
||||
// int lastDotIndex = fileName.LastIndexOf('.');
|
||||
//
|
||||
// // 如果没有点,说明没有扩展名
|
||||
// if (lastDotIndex == -1)
|
||||
// {
|
||||
// return fileName + JsonSuffix;
|
||||
// }
|
||||
//
|
||||
// // 提取文件名(不包括扩展名)
|
||||
// string fileNameWithoutExtension = fileName.Substring(0, lastDotIndex);
|
||||
// // 返回新的文件名,使用 .json 作为扩展名
|
||||
// return fileNameWithoutExtension + JsonSuffix;
|
||||
|
||||
// 如果没有点,说明没有扩展名
|
||||
if (lastDotIndex == -1)
|
||||
if (!fileName.EndsWith(JsonSuffix))
|
||||
{
|
||||
return fileName + JsonSuffix;
|
||||
}
|
||||
|
||||
// 提取文件名(不包括扩展名)
|
||||
string fileNameWithoutExtension = fileName.Substring(0, lastDotIndex);
|
||||
// 返回新的文件名,使用 .json 作为扩展名
|
||||
return fileNameWithoutExtension + JsonSuffix;
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user