예제 #1
0
        //---------------------------------
        // Load config from file
        //---------------------------------
        private void LoadConfig()
        {
            ConfigModel config = (ConfigModel)_config.Read();

            txtHost.Text     = config.Host;
            txtPort.Text     = config.Port.ToString();
            txtLogin.Text    = _crypto.Dectypt(config.Login);
            txtPassword.Text = _crypto.Dectypt(config.Password);
            txtInterval.Text = config.Interval.ToString();
        }
예제 #2
0
        private void tsBtnConnect_Click(object sender, EventArgs e)
        {
            ConfigModel config = (ConfigModel)binaryConfig.Read();

            if (sshClient.Open(config.Host, config.Port,
                               aesCrypto.Dectypt(config.Login), aesCrypto.Dectypt(config.Password)))
            {
                ubntClient.SetSSHClient(sshClient);
                Log("Connected.");
                GetStatus();
                timMain.Interval = config.Interval;
                timMain.Start();
                StatusOnConnect();
            }
        }