本文整理汇总了C#中ITerminal.Init方法的典型用法代码示例。如果您正苦于以下问题:C# ITerminal.Init方法的具体用法?C# ITerminal.Init怎么用?C# ITerminal.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITerminal
的用法示例。
在下文中一共展示了ITerminal.Init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
// Set up logger depending on OS
term = (Util.IsLinux() ? (ITerminal) new LinTerminal() : new WinTerminal());
term.Init();
term.WriteLine(@"+---------------------------------------+");
term.WriteLine(@"| Revolutionize web development with C# |");
term.WriteLine(@"+---------------------------------------+");
term.WriteLine(@"| _ _ _ _ _ _____ _____ |");
term.WriteLine(@"| | \ | | | | | \ | || ___|_ _| |");
term.WriteLine(@"| | \| | ___| |_ | \| || |__ | | |");
term.WriteLine(@"| | . ` |/ _ \ __| | . ` || __| | | |");
term.WriteLine(@"| | |\ | __/ |_ _| |\ || |___ | | |");
term.WriteLine(@"| \_| \_/\___|\__(_)_| \_/\____/ \_/ |");
term.WriteLine(@"+---------------------------------------+");
term.WriteLine(@"| An open source project by Inskey |");
term.WriteLine(@"+---------------------------------------+");
Logger.SetTerminal(term);
Logger.Log("Terminal set up for " + (Util.IsLinux() ? "Linux" : "Windows") + ".");
// Load all the pages
Logger.Log("Loading pages...");
short amount = LoadPages();
Logger.Log("Loaded " + amount + " pages.");
// Load all the resources
Logger.Log("Loading resources...");
amount = LoadResources();
Logger.Log("Loaded " + amount + " resources.");
// Load special pages, or copy them to the filesystem if they don't exist
//Logger.Log("Loading special pages...");
//LoadSpecials();
//Logger.Log("All specials loaded.");
// Start listening for HTTP connections
listener = new Listener();
listener.Open();
// Main thread becomes the command line thread
ConsoleLoop();
}