123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ZDHscript
- {
- class ColorClass
- {
- public static void InitConsole(string str)
- {
- WAR.RecordLog(str);
- Console.BackgroundColor = ConsoleColor.Blue; //设置背景色
- Console.ForegroundColor = ConsoleColor.White; //设置前景色,即字体颜色
- Console.WriteLine("***********************************************");
- Console.WriteLine("***********************************************");
- Console.WriteLine("*********** " + str + " **********");
- Console.WriteLine("************ " + DateTime.Now.ToString() + " ************");
- Console.WriteLine("***********************************************");
- Console.WriteLine("***********************************************");
- Console.ResetColor(); //将控制台的前景色和背景色设为默认值
- }
- public static void Console_strColor(string str)
- {
- WAR.RecordLog(str);
- Console.BackgroundColor = ConsoleColor.Green; //设置背景色
- Console.ForegroundColor = ConsoleColor.Black; //设置前景色,即字体颜色
- Console.WriteLine(str);
- Console.ResetColor(); //将控制台的前景色和背景色设为默认值
- }
- public static void Console_EorrColor(string str)
- {
- WAR.RecordLog(str);
- Console.BackgroundColor = ConsoleColor.Gray; //设置背景色
- Console.ForegroundColor = ConsoleColor.Red; //设置前景色,即字体颜色
- Console.WriteLine(str);
- Console.ResetColor(); //将控制台的前景色和背景色设为默认值
- }
- public static void Console_AddColor(string str)
- {
- WAR.RecordLog(str);
- Console.BackgroundColor = ConsoleColor.Black; //设置背景色
- Console.ForegroundColor = ConsoleColor.Green; //设置前景色,即字体颜色
- Console.WriteLine(str);
- Console.ResetColor(); //将控制台的前景色和背景色设为默认值
- }
- public static void Console_MessageColor(string str)
- {
- WAR.RecordLog(str);
- Console.BackgroundColor = ConsoleColor.Gray; //设置背景色
- Console.ForegroundColor = ConsoleColor.Green; //设置前景色,即字体颜色
- Console.WriteLine(str);
- Console.ResetColor(); //将控制台的前景色和背景色设为默认值
- }
- }
- }
|