Per Erik Strandberg /cv /kurser /blog

Really simple way to read instream from console In c#.

Code

using System;
using System.Collections.Generic;
using System.Text;

class smellyCat
{
  static void Main(string[] args)
  {
    Console.Write(Console.In.ReadToEnd());
  }
}

Output

dir *.cs | smellycat
 Volume in drive C has no label.
 Volume Serial Number is 7204-AD22

 Directory of C:\Documents and Settings\per\My Documents\Visual Studio 2005\Projects\smellycat

2007-03-01  09:45               182 smellycat.cs
               1 File(s)            182 bytes
               0 Dir(s)  15 067 529 216 bytes free


This page belongs in Kategori Programmering.