예제 #1
0
        public void WriteLine(string line)
        {
            string filePath = System.IO.Path.Combine(folderPath, Buzzer.stellarDate());

            CheckLog();
            using (System.IO.StreamWriter file =
                       new System.IO.StreamWriter(filePath, true))
            {
                file.WriteLine(Buzzer.now + " " + line);
            }
        }
예제 #2
0
        public void CheckLog()
        {
            string filePath = System.IO.Path.Combine(folderPath, Buzzer.stellarDate());

            if (!System.IO.File.Exists(filePath))
            {
                using (System.IO.FileStream fs = System.IO.File.Create(filePath))
                {
                    for (byte i = 0; i < 100; i++)
                    {
                        fs.WriteByte(i);
                    }
                }
                Console.WriteLine("File created");
            }
            else
            {
                Console.WriteLine("Log file already exists.");
                return;
            }
        }