EnterPasswordSuperSmallForm.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm
  10. {
  11. public partial class EnterPasswordSuperSmallForm : LYFZ.Software.UI.MembershipManage.SuperSmallForm.EnterPasswordSuperSmallForm
  12. {
  13. public EnterPasswordSuperSmallForm()
  14. {
  15. }
  16. /// <summary>
  17. /// 窗体要显示的中文名
  18. /// </summary>
  19. public string Pwd = "";
  20. /// <summary>
  21. /// 是否保存
  22. /// </summary>
  23. public bool IsSaveed = false;
  24. public string StrWindowText = "请输入密码";
  25. /// <summary>
  26. /// 窗体加载事件
  27. /// </summary>
  28. /// <param name="sender"></param>
  29. /// <param name="e"></param>
  30. protected override void EnterPasswordSuperSmallForm_Load(object sender, EventArgs e)
  31. {
  32. this.Text = this.StrWindowText;
  33. this.txtPassWord.Text = "";
  34. this.IsSaveed = false;
  35. this.txtPassWord.Focus();
  36. }
  37. /// <summary>
  38. /// 确定
  39. /// </summary>
  40. /// <param name="sender"></param>
  41. /// <param name="e"></param>
  42. protected override void btnOK_Click(object sender, EventArgs e)
  43. {
  44. if (this.txtPassWord.Text.Trim() != "")
  45. {
  46. this.Pwd = LYFZ.Command.Command_MD5.md5(this.txtPassWord.Text.Trim());
  47. this.IsSaveed = true;
  48. this.Close();
  49. }
  50. else { MessageBoxCustom.Show("请输入密码"); }
  51. }
  52. /// <summary>
  53. /// 取消
  54. /// </summary>
  55. /// <param name="sender"></param>
  56. /// <param name="e"></param>
  57. protected override void btnCancel_Click(object sender, EventArgs e)
  58. { this.Close(); }
  59. /// <summary>
  60. /// 回车
  61. /// </summary>
  62. /// <param name="sender"></param>
  63. /// <param name="e"></param>
  64. protected override void txtPassWord_KeyDown(object sender, KeyEventArgs e)
  65. {
  66. if (e.KeyCode == Keys.Enter)
  67. { this.btnOK_Click(this, null); }
  68. }
  69. }
  70. }