byte[] content=File.ReadAllBytes(@"C:\ServiceLog.txt");
FileStream stream = new FileStream(@"C:\ServiceLog1.txt", FileMode.Create, FileAccess.ReadWrite);
stream.Write(content, 0, content.Length);
stream.Close();
byte[] content=File.ReadAllBytes(@"C:\ServiceLog.txt");
File.WriteAllBytes(@"C:\12.txt",content);
// using System.IO;
string filepath = @"C:\test.txt";
using (StreamWriter writer = new StreamWriter(filepath)){
writer.WriteLine("some text");
}
while (true) {
// тут твой код делает свои грязные делишки
sleep(1);
}