testapp.cs

来自「Other things about csharp. you could lea」· CS 代码 · 共 36 行

CS
36
字号


using CustomStreams;
using System.IO;
using System;

class Application
{

	static void Main()
	{
		UpperCaseStream customStream;
		
		
		// Create a file using our custom stream (using ASCII encoding)

		customStream = new UpperCaseStream( new FileStream( "file.txt", FileMode.Create ) );
		StreamWriter sw = new StreamWriter( customStream,  System.Text.Encoding.ASCII );

		int i;

		for (i=0;i<100;i++)
			sw.WriteLine("Hello World!");
		sw.Close();


		
		// Create our custom stream, passing it a file stream 

		customStream = new UpperCaseStream( new FileStream( "file.txt", FileMode.Open ) );
		StreamReader sr = new StreamReader( customStream );
		Console.WriteLine("{0}",sr.ReadToEnd() );
		customStream.Close();

	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?