public QQService() { this.logger = new QQBotLogger(nameof(QQService)); this.botName = IniParse.INIGetValue(SharedInfo.ConfigFile, "GlobalConfig", "BotName"); this.botType = (BotType)IniParse.INIGetValue(SharedInfo.ConfigFile, "BotTypes", IniParse.INIGetValue(SharedInfo.ConfigFile, "GlobalConfig", "BotType")); this.workGroups = new List <string>(IniParse.INIGetValue(SharedInfo.ConfigFile, "GlobalConfig", "WorkGroup").Split(',')); }
public static void Main(string[] args) { logger = new QQBotLogger(SharedInfo.AppName); service = new QQService(); // 程序退出时关闭客户端 AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit); Console.CancelKeyPress += CurrentDomain_ProcessExit; // 启动服务 service.StartQQBot(); // 防止程序终止 logger.Info("程序正在运行,输入exit退出"); while (true) { var line = Console.ReadLine(); if ("exit" == line) { Environment.Exit(1); } } }
public BotService(String name) { logger = new QQBotLogger(name); }