Пример #1
0
 private void ButtonOk_Click(object sender, EventArgs e)
 {
     try
     {
         _slot.Login(_userType, TextBoxPin.Text);
         DialogResult = DialogResult.OK;
     }
     catch (Exception ex)
     {
         WinFormsUtils.ShowError(this, ex);
     }
 }
Пример #2
0
        private void ButtonOk_Click(object sender, EventArgs e)
        {
            try
            {
                byte[] pin = null;

                if (CheckBoxHexString.Checked)
                {
                    try
                    {
                        pin = ConvertUtils.HexStringToBytes(TextBoxPin.Text);
                    }
                    catch (Exception)
                    {
                        WinFormsUtils.ShowError(this, "Unable to decode HEX string");
                        return;
                    }
                }
                else
                {
                    try
                    {
                        pin = ConvertUtils.Utf8StringToBytes(TextBoxPin.Text);
                    }
                    catch (Exception)
                    {
                        WinFormsUtils.ShowError(this, "Unable to decode UTF-8 string");
                        return;
                    }
                }

                _slot.Login(_userType, pin);
                DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                WinFormsUtils.ShowError(this, ex);
            }
        }