Пример #1
0
        static void Main(string[] args)
        {
            string         s;
            string         encrPassword = "******";
            GlobalSettings mySettings   = GlobalSettingsIO.Load();

            var p = new Account();

            p.Name = "ICQ";
            mySettings.Accounts.Add(p);
            Console.WriteLine("Enter Login");
            s = Console.ReadLine();
            p.EncryptedLogin = Crypto.EncryptStringAES(s, encrPassword);
            Console.WriteLine(p.EncryptedLogin);


            Console.WriteLine("Enter pw");
            s = p.EncryptedPassword = Console.ReadLine();
            p.EncryptedPassword = Crypto.EncryptStringAES(s, encrPassword);
            Console.WriteLine(p.EncryptedPassword);


            Console.WriteLine("Enter TargetUserName");
            s = p.EncryptedTargetUserName = Console.ReadLine();
            p.EncryptedTargetUserName = Crypto.EncryptStringAES(s, encrPassword);
            Console.WriteLine(p.EncryptedTargetUserName);


            Console.WriteLine("Press enter to save");
            Console.ReadLine();
            GlobalSettingsIO.Save(mySettings);
        }
Пример #2
0
        static void Main(string[] args)
        {
            globalSettings = GlobalSettingsIO.Load();
            location       = new Location(globalSettings.SettingsURI, globalSettings.SettingsPath);
            commonModule   = new CommonModule(location.GetLocation(CommonModule.Filename));

            TestDaily();
            TestReply();

            Console.WriteLine("Tests Finisched, press a key");
            Console.ReadKey();
        }
Пример #3
0
        public static void Main(string[] args)
        {
            globalSettings = GlobalSettingsIO.Load();
            location       = new Location(globalSettings.SettingsURI, globalSettings.SettingsPath);

            if (!String.IsNullOrEmpty(globalSettings.UploadLogURI))
            {
                Log.WriteEvent += UploadLog;
            }

            Log.Debug("--------------------------------------------------");
            Log.Debug($"OSVersion: {Environment.OSVersion}");
            Log.Debug("Settings: " + globalSettings);

            List <String> DDLS = new List <string>();

            globalSettings.Accounts.FindAll(z => z.Enabled).ForEach(m => { DDLS.Add(m.DDLFilename); });
            plugins = MyPlugins <IConnector> .GetPlugins(DDLS.ToArray());

            InitCommon();
            InitReplies();
            InitDaily();

            plugins.ToList().ForEach(p => p.MessageReceived += P_MessageReceived);

            plugins.ElementAt(0).InitSession(globalSettings, globalSettings.Accounts[0]);

            if (globalSettings.PingMinutes > 0)
            {
                InitPing();
            }

            outgoingMsgMngr.Load();
            Log.Info("Resume Daily: " + outgoingMsgMngr);

            // Main send msg's loop
            ThrProcessOutgoingMsgList = new Thread(new ThreadStart(ProcessOutgoingMsgList));
            ThrProcessOutgoingMsgList.Start();

            while (true)
            {
                Thread.Sleep(60000);
            }
        }