C# 从txt读取内容
/// <summary> /// 从指定文件读取内容 /// </summary> /// <param name="file"></param> /// <returns></returns> private string ReadTxt(string file) { FileStream fs = new FileStream(file,FileMode.Open,FileAccess.Read); StreamReader reader = new StreamReader(fs); string content = reader.ReadToEnd(); reader.Close(); fs.Close(); return content; }