public void Save(string title, string player) { try { var r = #if DEBUG "..\\" #else string.Empty #endif ; var path = r + "MyPBO\\Logs\\" + player; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } using (StreamWriter sw = new System.IO.StreamWriter(path + string.Format("\\[{0}] {1}", DateTime.Now.ToString("yyyy-MM-dd-HHmmss"), title) + ".txt", false, Encoding.Unicode)) sw.Write(TextReport); } catch { ShowMessageBox.SaveLogFail(); } }