// public static void accessDenied(string area, string controller, string action) { StringBuilder txt = new StringBuilder(); txt.AppendLine("-----------------------------------------------------------------------------").Append("\n"); txt.Append("DATETIME: ").Append(DateTime.Now.ToShortDateString()).Append(" ").Append(DateTime.Now.ToShortTimeString()).Append("\n"); txt.Append("USER: "******"\n"); txt.Append("Area: " + area).Append("\n"); txt.Append("CONTROLLER: " + controller).Append("\n"); txt.Append("ACTION: " + action); txt.AppendLine("\n--------------------------------------------------------------------------").Append("\n\n"); string pathFile = @UtilConfig.pathAbsTempFiles + ("accessdenied_" + DateTime.Now.ToShortDateString().Replace("/", "") + ".txt"); if (!File.Exists(pathFile)) { File.Create(pathFile).Close(); } TextWriter Writer = File.AppendText(pathFile); Writer.Write(txt.ToString()); Writer.Close(); }