コード例 #1
0
        private bool isAllInputValid()
        {
            bool result = true;

            List <string> bindingAddressList = new List <string>();

            if (String.IsNullOrEmpty(serverDesc.Text) || (serverDesc.ForeColor == Color.Gray))
            {
                Ui_Utility.popupAlertBox("Please enter the FTP server description.");
                serverDesc.Focus();
                result = false;
            }
            else
            {
                if (!isBindingAddressSelected())
                {
                    Ui_Utility.popupAlertBox("Please select at least one binding address.");
                    ipAddressList.Focus();
                    result = false;
                }
                else
                {
                    controlPortNo = getControlPortNo();
                    if (controlPortNo == -1)
                    {
                        Ui_Utility.popupAlertBox("Please enter an valid control port no.(0-65535).");
                        controlPort.Focus();
                        result = false;
                    }
                    else
                    {
                        if (supportPassiveMode.Text.Equals("Yes"))
                        {
                            if (!Utility.isValidPassiveModePortRange(passiveModePortRange.Text))
                            {
                                result = false;
                                Ui_Utility.popupAlertBox("Please enter an valid TCP port range for passive mode");
                                passiveModePortRange.Focus();
                            }
                        }
                    }
                }
            }
            return(result);
        }
コード例 #2
0
        private bool isAllInputValid()
        {
            bool isValidate = true;

            adminServerName = serverName.Text.Trim();
            if (String.IsNullOrEmpty(adminServerName))
            {
                Ui_Utility.popupAlertBox("Please enter the admin. server name or IP address.");
                serverName.Focus();
                isValidate = false;
            }
            else
            {
                if (String.IsNullOrEmpty(portNo.Text))
                {
                    Ui_Utility.popupAlertBox("Please enter the admin. server port no. (0-65535).");
                    portNo.Focus();
                    isValidate = false;
                }
                else
                {
                    adminPortNo   = Convert.ToInt32(portNo.Text);
                    adminUserName = userName.Text.Trim();
                    if (String.IsNullOrEmpty(adminUserName))
                    {
                        Ui_Utility.popupAlertBox("Please enter the admin. user name.");
                        userName.Focus();
                        isValidate = false;
                    }
                    else
                    {
                        adminUserPassword = password.Text.Trim();
                        if (String.IsNullOrEmpty(adminUserPassword))
                        {
                            Ui_Utility.popupAlertBox("Please enter the admin. user password.");
                            password.Focus();
                            isValidate = false;
                        }
                    }
                }
            }
            return(isValidate);
        }