private void DeleteLogFile(string path) { try { File.Delete(path); } catch { } if (!IsLogFileEmpty(path)) { try { File.Open(path, FileMode.Truncate, FileAccess.Write, FileShare.Read).Close(); } catch { } } }