示例#1
0
 /// <summary>
 /// 读取指定文件路径的文件内容
 /// </summary>
 /// <param name="filePath"></param>
 /// <param name="encoding"></param>
 /// <returns></returns>
 public static string ReadToEnd(this string filePath, Encoding encoding)
 {
     return(FileUnity.ReadStringAsync(filePath, encoding).ConfigureAwait(false).GetAwaiter().GetResult());
 }
示例#2
0
 /// <summary>
 /// 读取指定文件路径的文件内容
 /// </summary>
 /// <param name="filePath"></param>
 /// <param name="encoding"></param>
 /// <returns></returns>
 public static async Task <string> ReadToEndAsync(this string filePath, Encoding encoding)
 {
     return(await FileUnity.ReadStringAsync(filePath, encoding).ConfigureAwait(false));
 }