/// <summary>
/// WinFrom验证码的实现
/// </summary>
/// <param name="pictureBox1"></param>
/// <returns></returns>
public static string pictureBoxVerification(PictureBox pictureBox1) {
Random r = new Random();
string str = null;
for (int i = 0; i < 5; i++)
{
int rNumber = r.Next(0, 10);
str += rNumber;
}
//MessageBox.Show(str);
//创建GDI对象
Bitmap bmp = new Bitmap(150, 40);
Graphics g = Graphics.FromImage(bmp);
for (int i = 0; i < 5; i++)
{
Point p = new Point(i * 20, 0);
string[] fonts = { "微软雅黑", "宋体", "隶属", "仿宋", "黑体" };
Color[] colors = {
WinFrom验证码的实现
最新推荐文章于 2019-08-17 12:46:27 发布