Beispiel #1
0
        private void LoadSelectedServer()
        {
            if (ServersListBox.SelectedIndex >= 0 && ServersListBox.SelectedIndex < _modifiedConfiguration.configs.Count)
            {
                Server server = _modifiedConfiguration.configs[ServersListBox.SelectedIndex];

                IPTextBox.Text         = server.server;
                ServerPortTextBox.Text = server.server_port.ToString();
                PasswordTextBox.Text   = server.password;
                EncryptionSelect.Text  = server.method ?? "aes-256-cfb";
                if (server.protocol == null || server.protocol.Length == 0)
                {
                    TCPProtocolComboBox.Text = "origin";
                }
                else
                {
                    TCPProtocolComboBox.Text = server.protocol ?? "origin";
                }
                ObfsCombo.Text          = server.obfs ?? "plain";
                textObfsParam.Text      = server.obfsparam;
                RemarksTextBox.Text     = server.remarks;
                CheckTCPoverUDP.Checked = server.tcp_over_udp;
                CheckUDPoverUDP.Checked = server.udp_over_tcp;
                CheckObfsUDP.Checked    = server.obfs_udp;
                _SelectedID             = server.id;

                ServerGroupBox.Visible = true;

                if (checkRemarks.Checked)
                {
                    TextLink.Text = controller.GetSSRemarksLinkForServer(server);
                }
                else
                {
                    TextLink.Text = controller.GetSSLinkForServer(server);
                }

                PasswordLabel.Checked = false;
                GenQR(TextLink.Text);
                //IPTextBox.Focus();
            }
            else
            {
                ServerGroupBox.Visible = false;
            }
        }