FileStream fs = new FileStream(@"d:service.txt", FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
using ( fs)
{
using (sw)
{
sw.BaseStream.Seek(0, SeekOrigin.End);
sw.WriteLine("WindowsService: Service Started" + DateTime.Now.ToString() + "
");
sw.Flush();
}
}