My personal C# library for simplizing coding experience.
Welcome to dev or modify it because it's under MIT license.
This is a logging helper.
You can record logs like casual Console.WriteLine() but using ARConsole.WriteLine();
This is the CUI style of the console.
It has 4 kinds of colors indicating your logs.
Default - White - Normal Message
Harmless - Green - Normal Message
Further - Yellow - Further Information
Critical - Red - Critical Message
Redirected - Cyan - For CMD Commands Executing Results
Below is a sample code that shows you how to use the ARConsole.
static void Main(string[] args)
{
ARConsole.CreateConsole(true, "ARConsole", false);
ARConsole.CRLF();
ARConsole.WriteLine("Default Message Color. With Default Param.");
ARConsole.WriteLine("Default Message Color. With Default Param.", MsgLevel.Default);
ARConsole.WriteLine("Harmless Message Color. With Default Param.", MsgLevel.Harmless);
ARConsole.WriteLine("Further Message Color. With Default Param.", MsgLevel.Further);
ARConsole.WriteLine("Critical Message Color. With Default Param.", MsgLevel.Critical);
ARConsole.AsyncExecuteCMD("NSLOOKUP -QT=A BLOG.AR-DISTRIBUTED.COM 8.8.8.8");
ARConsole.ExecuteCMD("TASKLIST | FINDSTR AWCC.Service");
while(!ARConsole.TasksComplete)
{
System.Threading.Thread.Sleep(100);
}
}
This is the GUI style of the console.
What's different between CUI and GUI style is that CMD commands executing results will be shown in a message box poping.
And to ensure the safety of the current process, a CUI console will be created if the GUI console is disposed by the user.
Below is a sample code that shows you how to use the ARConsole.
static void Main(string[] args)
{
ARConsole.CreateConsole(true, "ARConsole", true);
ARConsole.CRLF();
ARConsole.WriteLine("Default Message Color. With Default Param.");
ARConsole.WriteLine("Default Message Color. With Default Param.", MsgLevel.Default);
ARConsole.WriteLine("Harmless Message Color. With Default Param.", MsgLevel.Harmless);
ARConsole.WriteLine("Further Message Color. With Default Param.", MsgLevel.Further);
ARConsole.WriteLine("Critical Message Color. With Default Param.", MsgLevel.Critical);
ARConsole.AsyncExecuteCMD("NSLOOKUP -QT=A BLOG.AR-DISTRIBUTED.COM 8.8.8.8");
ARConsole.ExecuteCMD("TASKLIST | FINDSTR AWCC.Service");
Console.ReadKey();
}