Public · Protected · Private
File line count
Type: Public  |  Created: 2009-11-13  |  Frozen: Yes
« Previous Public Blog Next Public Blog »
Comments
  • static long CountLinesInFile(string f) { long count = 0; using (StreamReader r = new StreamReader(f)) { string line; while ((line = r.ReadLine()) != null) { count++; } } return count; } CountLinesInFile(@"c:\test.txt");
    2009-11-13 22:45
This blog is frozen. No new comments or edits allowed.