blob: fce69102831f998a7dcdd249ba9c2c1ff50c2dea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
using System;
using System.IO;
string file = "C:/tmp/io.txt";
StreamWriter writer = File.CreateText(file);
for(int i=1; i<=50; i++)
{
writer.WriteLine(i);
}
writer.Close();
StreamReader reader = File.OpenText(file);
string line = reader.ReadLine();
for(int i=0; line != null; i++, line = reader.ReadLine())
{
if(i % 5 == 0)
Console.Read();
Console.WriteLine(line);
}
reader.Close();
File.Delete(file);
|