示例#1
0
        public static void Main()
        {
            const string confFileName = "robokins.conf";

            if (!File.Exists(confFileName))
                throw new FileNotFoundException("Configuration file not found.", confFileName);
            var conf = ConfRead(new StreamReader(confFileName));

            string usernm = "";
            var passwd = new SecureString();
            string chanls = "";

            usernm = GetKeyValue(conf, "username");
            passwd = GetKeySecureValue(conf, "password");
            chanls = GetKeyValue(conf, "channels");

            Tests(passwd);

            var bot = new Bot(usernm, passwd, chanls);
            bot.Server = GetKeyValue(conf, "server");
            bot.Port = GetKeyIntValue(conf, "port");
            bot.Website = GetKeyValue(conf, "website");

            bot.Start();
        }