private void btTestLogical_Click(object sender, EventArgs e) { using (LogFile file = new LogFile()) { file.Write("Я работаю!!!"); MessageBox.Show(String.Format("Файл с логом {0}", file.FileName)); } }
protected override void OnStart(string[] args) { file = new LogFile(); file.Write("OnStart"); }