文件名称:ChineseCode
- 所属分类:
- C#编程
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2013-04-22
- 文件大小:
- 11kb
- 下载次数:
- 0次
- 提 供 者:
- hpu****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
中文验证码源码,C#完美实例,自带判断模块,下面简要说一下本中文验证码的实现思路:获取GB2312编码页(表),调用函数产生4个随机中文汉字编码,根据汉字编码的字节数组解码出中文汉字,生成随机生成器,清空图片背景色,画图片的背景噪音线,画图片的前景噪音点,画图片的边框线。
CreateCode函数在汉字编码范围内随机创建含两个元素的十六进制字节数组,每个字节数组代表一个汉字,并将 四个字节数组存储在object数组中,参数:strlength,代表需要产生的汉字个数。每循环一次产生一个含两个元素的十六进制字节数组,并将其放入bject数组中,每个汉字有四个区位码组成,区位码第1位和区位码第2位作为字节数组第一个元素,区位码第3位和区位码第4位作为字节数组第二个元素,同时程序内更换随机数发生器的种子避免产生重复值-The Chinese verification code source code, C# a perfect example, comes with a judging module, the following brief said the Chinese verification code realization of ideas: Get GB2312 code page (table), call the function to generate 4 random Chinese characters coding, according to the Chinese character coding bytesarray decoding Chinese characters, to generate a random generator, Clear picture background color, painting a picture of background noise lines, draw a picture of the prospects of noise points, draw the border line of the picture.
Function within the scope of Chinese character coding CreateCode randomly created hexadecimal byte array containing two elements, each byte array represents a character, and the four byte array is stored in the object array, parameters: strlength, on behalf of the need the number of Chinese characters. Each cycle produces a hexadecimal byte array containing two elements, and put it into bject array, each character consists of four area code, the area
CreateCode函数在汉字编码范围内随机创建含两个元素的十六进制字节数组,每个字节数组代表一个汉字,并将 四个字节数组存储在object数组中,参数:strlength,代表需要产生的汉字个数。每循环一次产生一个含两个元素的十六进制字节数组,并将其放入bject数组中,每个汉字有四个区位码组成,区位码第1位和区位码第2位作为字节数组第一个元素,区位码第3位和区位码第4位作为字节数组第二个元素,同时程序内更换随机数发生器的种子避免产生重复值-The Chinese verification code source code, C# a perfect example, comes with a judging module, the following brief said the Chinese verification code realization of ideas: Get GB2312 code page (table), call the function to generate 4 random Chinese characters coding, according to the Chinese character coding bytesarray decoding Chinese characters, to generate a random generator, Clear picture background color, painting a picture of background noise lines, draw a picture of the prospects of noise points, draw the border line of the picture.
Function within the scope of Chinese character coding CreateCode randomly created hexadecimal byte array containing two elements, each byte array represents a character, and the four byte array is stored in the object array, parameters: strlength, on behalf of the need the number of Chinese characters. Each cycle produces a hexadecimal byte array containing two elements, and put it into bject array, each character consists of four area code, the area
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ChineseCode\ChineseCode\ChineseCode.csproj
...........\...........\Form1.cs
...........\...........\Form1.Designer.cs
...........\...........\Form1.resx
...........\...........\Program.cs
...........\...........\...perties\AssemblyInfo.cs
...........\...........\..........\Resources.Designer.cs
...........\...........\..........\Resources.resx
...........\...........\..........\Settings.Designer.cs
...........\...........\..........\Settings.settings
...........\ChineseCode.sln
...........\...........\Properties
...........\ChineseCode
ChineseCode