// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.IO; using System.Threading; namespace E { public class Program { public static void Main(string[] args) { using(StreamWriter sw = new StreamWriter(new FileStream(@"C:\foobar.dat", FileMode.Create, FileAccess.Write, FileShare.Read))) { for(int i = 0; i < 100; i++) { sw.WriteLine("Bla bla"); sw.WriteLine(DateTime.Now.ToLongTimeString()); sw.Flush(); Thread.Sleep(10000); } } } } }