您可以使用System.IO.File.ReadAllText函数将文件的全部内容读取为字符串。
string text = System.IO.File.ReadAllText(@"C:\MyFolder\MyTextFile.txt");
您还可以使用System.IO.File.ReadAllLines函数将文件读取为行数组:
string[] lines = System.IO.File.ReadAllLines(@"C:\MyFolder\MyTextFile.txt");
友情链接: json在线解析 通晓查询 糯晒黄历 姓名打分