先是consolecolour.cs类,用来调用颜色
// ConsoleColour.cs
using System;
// need this to make API calls
using System.Runtime.InteropServices;
namespace PFitzsimons.ConsoleColour
{
/// <summary>
/// Static class for console colour manipulation.
/// </summary>
public class ConsoleColour
{
// constants for console streams
const int STD_INPUT_HANDLE = -10;
const int STD_OUTPUT_HANDLE = -11;
const int STD_ERROR_HANDLE = -12;
[DllImportAttribute("Kernel32.dll")]
private static extern IntPtr GetStdHandle
(
int nStdHandle // input, output, or error device
);
[DllImportAttribute("Kernel32.dll")]
private static extern bool SetConsoleTextAttribute
(
IntPtr hConsoleOutput, // handle to screen buffer
int wAttri