Update
This commit is contained in:
ALEXTANG
2022-05-24 18:12:17 +08:00
parent 6210778de3
commit c9fafcaef0
4 changed files with 52 additions and 1 deletions

View File

@@ -126,5 +126,28 @@ namespace TEngine
return File.OpenRead(filePath);
#endif
}
/// <summary>
/// 从指定文件中读取字节串
/// </summary>
/// <param name="filePath">文件路径</param>
/// <returns></returns>
public static byte[] ReadAllBytesFromOutOrInnerFolder(string filePath)
{
if (string.IsNullOrEmpty(filePath))
return null;
return ReadAllBytesFromOutFolder(filePath);
}
private static byte[] ReadAllBytesFromOutFolder(string filePath)
{
if (!File.Exists(filePath))
{
TLogger.LogError("file:[{0}] is not exist!, please check!", filePath);
return null;
}
return File.ReadAllBytes(filePath);
}
}
}