using System;
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace iWareCommon.Utils
|
{
|
public class TextHelper
|
{
|
/// <summary>
|
/// 读取text文本内容
|
/// </summary>
|
/// <param name="path"></param>
|
/// <returns></returns>
|
public static string ReadText(string path)
|
{
|
try
|
{
|
StreamReader sr = new StreamReader(path, Encoding.Default);
|
String line;
|
StringBuilder sb = new StringBuilder();
|
while ((line = sr.ReadLine()) != null)
|
{
|
sb.Append(line.ToString() + " \n");
|
}
|
return sb.ToString();
|
}
|
catch
|
{
|
throw;
|
}
|
}
|
}
|
}
|