控制台提示信息

 1 #region[操作后给出提示信息]
 2         static void WriteErrorInformation(string errorInformation)
 3         {
 4             Console.ForegroundColor = ConsoleColor.Red;
 5             Console.WriteLine("Error: " + errorInformation);
 6             Console.ForegroundColor = ConsoleColor.Gray;
 7         }
 8         static void WriteOuputInformation(string outputInformation)
 9         {
10             Console.ForegroundColor = ConsoleColor.DarkGreen;
11             Console.WriteLine("-->>" + outputInformation);
12             Console.ForegroundColor = ConsoleColor.Gray;
13         }
14 #endregion
View Code

报错:
WriteErrorInformation(string.Format("Exception: {0}", exp.Message));

成功:
WriteOuputInformation(string.Format("{0}:文档已经存入数据库", DetailUrl));

posted @ 2019-09-16 14:16  EnjoyToday  阅读(291)  评论(0编辑  收藏  举报