Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var FilePath = @"test.in.txt";
- // var data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- using (FileStream fs = new FileStream(FilePath, FileMode.Open))
- {
- using (BufferedStream bs = new BufferedStream(fs))
- {
- using (StreamReader textReader = new StreamReader(bs))
- {
- int maxLines = Int32.Parse(textReader.ReadLine());
- int countLines = 0;
- string line;
- int dot = 1;
- while ((line = textReader.ReadLine()) != null && countLines != maxLines + 1)
- {
- Console.WriteLine(dot);
- dot++;
- countLines++;
- // string key = line.Trim();
- // string value = textReader.ReadLine();
- // data.Add(key, value);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement