Advertisement
tango1603

Untitled

Oct 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. var FilePath = @"test.in.txt";
  2. // var data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  3. using (FileStream fs = new FileStream(FilePath, FileMode.Open))
  4. {
  5. using (BufferedStream bs = new BufferedStream(fs))
  6. {
  7. using (StreamReader textReader = new StreamReader(bs))
  8. {
  9. int maxLines = Int32.Parse(textReader.ReadLine());
  10.  
  11. int countLines = 0;
  12. string line;
  13. int dot = 1;
  14. while ((line = textReader.ReadLine()) != null && countLines != maxLines + 1)
  15. {
  16. Console.WriteLine(dot);
  17. dot++;
  18. countLines++;
  19.  
  20. // string key = line.Trim();
  21. // string value = textReader.ReadLine();
  22. // data.Add(key, value);
  23. }
  24. }
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement