Log file create using c# in MS crm
#region NameSpaces using System.IO; using System; using System.Windows.Forms; #endregion namespace EmailAttachments { //This is Log File class Log { static string baseDirectory = CustomException.baseDirectory; static string LogFile = ""; #region Constructor /// <summary> /// Parameterized Constructor /// </summary> public Log(string logFile) { try { if (CustomException.HasPermissions(baseDirectory)) { if (!logFile.Contains(".txt")) { logFile = logFile + ".txt"; } LogFile = baseDirectory + logFile;//+"_"+DateTime.Now.ToString("MMddyyyyhhmm"); if (!Directory.Exists(baseDirectory)) { System.IO.Directory.CreateDirectory(baseDirectory); }