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";
                ObfsCombo.Text                    = server.obfs ?? "plain";
                RemarksTextBox.Text               = server.remarks;
                CheckTCPoverUDP.Checked           = server.tcp_over_udp;
                CheckUDPoverUDP.Checked           = server.udp_over_tcp;
                TCPProtocolComboBox.SelectedIndex = server.tcp_protocol;
                CheckObfsUDP.Checked              = server.obfs_udp;

                ServerGroupBox.Visible = true;

                TextLink.Text = controller.GetSSLinkForServer(server);

                PasswordLabel.Checked = false;
                GenQR(TextLink.Text);
                //IPTextBox.Focus();
            }
            else
            {
                ServerGroupBox.Visible = false;
            }
        }
Beispiel #2
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;
            }
        }
Beispiel #3
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;
                ProxyPortTextBox.Text   = _modifiedConfiguration.localPort.ToString();
                EncryptionSelect.Text   = server.method ?? "aes-256-cfb";
                RemarksTextBox.Text     = server.remarks;
                CheckTCPoverUDP.Checked = server.tcp_over_udp;
                CheckUDPoverUDP.Checked = server.udp_over_tcp;
                CheckObfsTCP.Checked    = server.obfs_tcp;
                CheckObfsUDP.Checked    = server.obfs_udp;

                ServerGroupBox.Visible       = true;
                ReconnectText.Text           = _modifiedConfiguration.reconnectTimes.ToString();
                RandomComboBox.SelectedIndex = _modifiedConfiguration.randomAlgorithm;
                TTLText.Text = _modifiedConfiguration.TTL.ToString();

                CheckSocks5Proxy.Checked = _modifiedConfiguration.socks5enable;
                TextS5Server.Text        = _modifiedConfiguration.socks5Host;
                TextS5Port.Text          = _modifiedConfiguration.socks5Port.ToString();
                TextS5User.Text          = _modifiedConfiguration.socks5User;
                TextS5Pass.Text          = _modifiedConfiguration.socks5Pass;

                TextLink.Text = controller.GetSSLinkForServer(server);

                CheckAutoBan.Checked = _modifiedConfiguration.autoban;

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