using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VerCode
{
public partial class VerCodeForm : Form
{
public VerCodeForm()
{
InitializeComponent();
}
private void picCodeWrapper_Click(object sender, EventArgs e)
{
Random rd = new Random();
string str = null;
// 生成随机数
for (int i = 0; i < 5; i++)
{
int rdCode = rd.Next(0, 9);
str += rdCode;
}
Bitmap bmp = new Bitmap(200, 40);
Graphics g = Graphics.FromImage(bmp);
// 绘制验证码
for (int i = 0; i < 5; i++)
{
Point p = new Point(i * 35, 0);
string[]
C#绘制窗体验证码
最新推荐文章于 2022-11-25 14:53:15 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)