文章分类 - 验证码
摘要:文章转至:http://www.cnblogs.com/yuanbao/archive/2007/11/14/958488.html1、如何设前景/背景的分界值 UnCodebase类中有一个GetPicValidByValue( intdgGrayValue) 函数,可以得到前景的有效区域,常有人问我前景/背景的分界值dgGrayValue是如何确定的(常用的是灰度128)。这个值的获取是有数学...
阅读全文
摘要:1、汉字编码原理 到底怎么办到随机生成汉字的呢?汉字从哪里来的呢?是不是有个后台数据表,其中存放了所需要的所有汉字,使用程序随机取出几个汉字组合就行了呢?使用后台数据库先将所有汉字存起来使用时随机取出,这也是一种办法,但是中文汉字有这么多,怎么来制作呢?其实可以不使用任何后台数据库,使用程序就能做到这一切。要知道如何生成汉字,就得先了解中文汉字的编码原理。 1980年,为了使每一个汉字有一个全国统...
阅读全文
摘要:usingSystem;usingSystem.IO;usingSystem.Web;usingSystem.Web.UI;usingSystem.Drawing;usingSystem.Drawing.Drawing2D;usingSystem.Drawing.Imaging;namespaceMis.Pages{publicclassthink_test:System.Web.UI.Page{...
阅读全文
摘要:下面是GDI+绘图的代码段,以及显示的调用等 usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSy...
阅读全文
摘要:1、判断字符串是否为连续的中文字符(不包含英文及其他任何符号和数字):Regex.IsMatch("中文","^[\u4e00-\u9fa5]+$");2、判断字符串是否为中文字符串(仅不包含英文但可以包含其他符号及数字):!Regex.IsMatch("中文",@"[a-zA-Z]");
阅读全文
摘要:#region ASP.NET 图片验证码public string GenerateCheckCode() {int number;char code;string checkCode = String.Empty;System.Random random = new Random();for(int i=0; i<5; i++) {number = random.Next();if(nu...
阅读全文
摘要:public int[] getRandomNum(int num,int minValue,int maxValue){ Random ra=new Random(unchecked((int)DateTime.Now.Ticks)); int[] arrNum=new int[num]; redo: int tmp=0; for (int i=0;i<=num-1;i++) { tmp=...
阅读全文

浙公网安备 33010602011771号