C# 读取txt文件
public static List<int> GetPage()
{
string strpath = @"D:\test.txt";
FileStream fs = new FileStream(strpath, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs, Encoding.Default);
sr.BaseStream.Seek(0, SeekOrigin.Begin);
string str = sr.ReadLine();
while (str != null)
{
str = sr.ReadLine();
}
sr.Close();
fs.Close();
return ListPage;
}
Goals determine what you are going to be!