C# 读取文本文件

读取所有的行

返回字符串数组

string[] lines = File.ReadAllLines(path)

读取所有内容

返回字符串类型

string txt = File.ReadAllText(path)