📄 loginform.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace CSharpNotepad
{
public partial class loginForm : Form
{
public loginForm()
{
InitializeComponent();
}
private void loginForm_Load(object sender, EventArgs e)
{
this.AcceptButton = okButton;
}
private void okButton_Click(object sender, EventArgs e)
{
if (this.textBox1.Text == "admin" && this.textBox2.Text == "admin")
{
this.Hide();
mainForm mf = new mainForm();
mf.ShowDialog();
this.Close();
}
else
{
this.lbErrorMsg.Text = "提示:用户名或密码错误,请重新输入。";
this.textBox2.Focus();
}
}
private void cancelButton_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -