예제 #1
0
        public static DialogResult AskCredentials
            (string Caption,
            string Remark,
            ref string Password)
        {
            var dial = new CredentialsDialog();
            dial.labelRemark.Text = Remark;
            dial.Text = Caption;
            dial.textBoxUsername.Enabled = false;
            dial.textBoxPassword.Text = Password;
            dial.StartPosition = FormStartPosition.CenterScreen;

            var ret = dial.ShowDialog();

            if (ret == DialogResult.OK)
            {
                Password = dial.textBoxPassword.Text;
            }

            return ret;
        }
예제 #2
0
        public static DialogResult AskCredentials
            (string Caption,
            string Remark,
            ref string UserName,
            ref string Password)
        {
            var dial = new CredentialsDialog();
            dial.labelRemark.Text = Remark;
            dial.Text = Caption;
            dial.textBoxUsername.Text = UserName;
            dial.textBoxPassword.Text = Password;

            var ret = dial.ShowDialog();

            if (ret == DialogResult.OK)
            {
                UserName = dial.textBoxUsername.Text;
                Password = dial.textBoxPassword.Text;
            }

            return ret;
        }