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 GDI验证码
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
SetCode();
}
Random sj = new Random();
string zhuangwenzi;
private void SetCode()
{
zhuangwenzi = "";
for (int i = 0; i < 4; i++)
{
int nex=sj.Next(0, 2);
if (nex==0)
{
zhuangwenzi+=sj.Next(0,10);
}
if (nex==1)
{
zhuangwenzi +=(char)sj.Next(97,123);
}
}
if (string.IsNullOrWhiteSpace(zhuangwenzi))//如果进来是空的就返回
{
GDI+水印(很简单很简单的版)
最新推荐文章于 2021-03-22 16:58:37 发布