Login.cs
上传用户:yzllxs
上传日期:2020-11-17
资源大小:530k
文件大小:2k
源码类别:

中间件编程

开发平台:

C#

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. // Download by http://www.codefans.net
  9. namespace HookLock
  10. {
  11.     public partial class Login : Form
  12.     {
  13.         public Login()
  14.         {
  15.             InitializeComponent();
  16.         }
  17.         private Point loc = Point.Empty;
  18.         private Form1 f1 = new Form1();
  19.         private void btnOK_Click(object sender, EventArgs e)
  20.         {
  21.             if (this.passwork.Text.Equals("") && this.passwork2.Text.Equals(""))
  22.             {
  23.                 this.label5.Visible = true;
  24.                 this.label5.Text = "密码不能为空!";
  25.             }
  26.             else if (this.passwork.Text != this.passwork2.Text)
  27.             {
  28.                 this.toolTip1.Show("两次设置的密码不一样。", this.passwork, 600);
  29.                 this.label5.Visible = false;
  30.             }
  31.             else
  32.             {
  33.                 base.Visible = false;
  34.                 if (this.cbbox.SelectedItem.ToString().Equals("100%"))
  35.                 {
  36.                     this.f1.getinfo(this.passwork.Text, 10.0);
  37.                 }
  38.                 else
  39.                 {
  40.                     this.f1.getinfo(this.passwork.Text, double.Parse(this.cbbox.SelectedItem.ToString().Remove(1)));
  41.                 }
  42.                 this.f1.Show();
  43.                 this.Hide();
  44.             }
  45.         }
  46.         private void passwork2_KeyDown(object sender, KeyEventArgs e)
  47.         {
  48.             if (e.KeyCode == Keys.Return)
  49.             {
  50.                 this.btnOK_Click(null, null);
  51.             }
  52.         }
  53.         private void btnCancel_Click(object sender, EventArgs e)
  54.         {
  55.             if (MessageBox.Show("退出此程序?", "操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
  56.             {
  57.                 Application.Exit();
  58.             }
  59.         }
  60.         private void Login_Load(object sender, EventArgs e)
  61.         {
  62.             this.cbbox.SelectedItem = "100%";
  63.             this.skinEngine1.SkinFile = "PageColor2.ssk";
  64.         }
  65.        
  66.     }
  67. }