private void Form11_Load(object sender, EventArgs e)
{
GetVerCode();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text != null && textBox1.Text != "")
{
if (textBox1.Text == label1.Text)
{
MessageBox.Show("验证成功!");
}
else
{
MessageBox.Show("验证码错误!");
}
}
else
{
MessageBox.Show("请输入验证码!");
}
}
private void button2_Click(object sender, EventArgs e)
{
GetVerCode();
}
public void GetVerCode()
{
//获取GB2312编码页(表)
Encoding gb = Encoding.GetEncoding("gb2312");
//调
C#生成四位汉子验证码
最新推荐文章于 2023-07-27 11:20:09 发布