?? login.cs
字號(hào):
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Myschool
{
public partial class Login : Form
{
public static string name = "";//用戶名
public Login()
{
InitializeComponent();
}
private void Login_Load(object sender, EventArgs e)
{
this.comtype.SelectedIndex = 0;//設(shè)置默認(rèn)選中第一個(gè)
this.radblue.Checked = true;
skinEngine.SkinFile = "DiamondBlue.ssk";
}
private void btngiveup_Click(object sender, EventArgs e)
{
Application.Exit();//退出程序事件
}
private void btnlogin_Click(object sender, EventArgs e)
{
LoginPanduan();
}
//判斷登錄的方法
private void LoginPanduan()
{
//獲得前臺(tái)數(shù)據(jù)
name = txtname.Text;
string pwd = txtpwd.Text;
if ("" == name)
{
MessageBox.Show("請(qǐng)輸入用戶名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.txtname.Focus();
return;
} if ("" == pwd)
{
MessageBox.Show("請(qǐng)輸入密碼!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.txtpwd.Focus();
return;
}
bool b = Ado.select(name, pwd);
if (b)
{
new MainForm().Show();
this.Visible = false;
}
else
{
MessageBox.Show("用戶名或密碼錯(cuò)誤!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.txtname.Focus();
}
}
private void radblue_Click(object sender, EventArgs e)
{
skinEngine.SkinFile = "DiamondBlue.ssk";
}
private void radgreen_Click(object sender, EventArgs e)
{
skinEngine.SkinFile = "DiamondGreen.ssk";
}
private void btnlogin_KeyDown(object sender, KeyEventArgs e)
{
LoginPanduan();
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -