summary refs log tree commit diff
path: root/io/Program.cs
diff options
context:
space:
mode:
author1970-01-01 00:00:00 +0000
committer2025-01-08 04:13:03 +0000
commit212a8c3926d835e3abe5abaf9744945ec78aa158 (patch)
tree895bec2e78bac7155fdd68f56b2aa5eb1abd85db /io/Program.cs
parentclicker (diff)
downloadcs-212a8c3926d835e3abe5abaf9744945ec78aa158.tar
cs-212a8c3926d835e3abe5abaf9744945ec78aa158.tar.gz
cs-212a8c3926d835e3abe5abaf9744945ec78aa158.tar.bz2
cs-212a8c3926d835e3abe5abaf9744945ec78aa158.tar.xz
cs-212a8c3926d835e3abe5abaf9744945ec78aa158.zip
io
Diffstat (limited to 'io/Program.cs')
-rw-r--r--io/Program.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/io/Program.cs b/io/Program.cs
new file mode 100644
index 0000000..fce6910
--- /dev/null
+++ b/io/Program.cs
@@ -0,0 +1,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);
\ No newline at end of file