ChineseCode

所属分类:C#编程
开发工具:C#
文件大小:11KB
下载次数:6
上传日期:2013-04-22 20:07:41
上 传 者hpudn89
说明:  中文验证码源码,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)

文件列表:
ChineseCode\ChineseCode\ChineseCode.csproj (3768, 2008-09-16)
ChineseCode\ChineseCode\Form1.cs (6677, 2013-03-08)
ChineseCode\ChineseCode\Form1.Designer.cs (4601, 2013-03-08)
ChineseCode\ChineseCode\Form1.resx (5814, 2008-09-16)
ChineseCode\ChineseCode\Program.cs (529, 2013-03-08)
ChineseCode\ChineseCode\Properties\AssemblyInfo.cs (1354, 2008-09-16)
ChineseCode\ChineseCode\Properties\Resources.Designer.cs (2872, 2008-09-16)
ChineseCode\ChineseCode\Properties\Resources.resx (5612, 2008-09-16)
ChineseCode\ChineseCode\Properties\Settings.Designer.cs (1096, 2008-09-16)
ChineseCode\ChineseCode\Properties\Settings.settings (249, 2008-09-16)
ChineseCode\ChineseCode.sln (923, 2008-09-16)
ChineseCode\ChineseCode\Properties (0, 2013-03-08)
ChineseCode\ChineseCode (0, 2013-03-08)
ChineseCode (0, 2013-03-08)

近期下载者

相关文件


收藏者