110,536
社区成员
发帖
与我相关
我的任务
分享
File file = new File(filePath);
if (file.exists()) {
// allreadyRunIds
List<String> lines = null;
try {
lines = IOUtils.readLines(new FileInputStream(file), "utf-8");
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
allreadyRunIds.addAll(lines);
System.out.println("数据行数:" + lines.size());
}
StreamReader sr = new StreamReader(path);
List<string> list = new List<string>();
int i = 0;
string readLine = sr.ReadLine();
while(readLine!=null&&readLine!="")
{
//list.Add(readLine); 用List过会儿直接崩了
i++;
sr.ReadLine();
}
Console.WriteLine(i);
Console.ReadKey();