// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using System.IO; using System.IO.Pipes; public class PServer { public static void Main(string[] args) { using(NamedPipeServerStream pipe = new NamedPipeServerStream("test")) { pipe.WaitForConnection(); using(StreamReader sr = new StreamReader(pipe)) { for(int i = 0; i < 10000000; i++) { if(sr.ReadLine() != "Dette er en test") { throw new Exception("Ooops"); } } } } } }