最容易使用的验证码控件(附代码)
this.ImageWidth = p.ImageWidth;
this.ImageHeight = p.ImageHeight;
string text = this.Manager.PeekImageText(p.Identification);
if (text == null)
throw new Gugu.CheckBotComponent.CheckBotException("画图前验证码图像文字不能为空。");
if (this.PreDrawText != null)
this.PreDrawText(this, System.EventArgs.Empty);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(0, 0, this.ImageWidth, this.ImageHeight);
bitmap = new System.Drawing.Bitmap(this.ImageWidth, this.ImageHeight); g = System.Drawing.Graphics.FromImage(bitmap);
if (this.DrawText != null)
this.DrawText(this, new Gugu.CheckBotComponent.CheckBotDrawTextEventArgs(text, rect, g,p.ExpectTextBackColor,p.ExpectTextColor,p.ExPara));
else
{
Gugu.CheckBotComponent.CheckBotDrawTextArgs dp = new Gugu.CheckBotComponent.CheckBotDrawTextArgs(text, rect, g,p.ExpectTextBackColor,p.ExpectTextColor,p.ExPara);
this.Drawer.DrawText(dp);
}
}
catch (Gugu.CheckBotComponent.CheckBotException)
{
if (g != null)
g.Dispose();
if (bitmap != null)
bitmap.Dispose();
bitmap = new System.Drawing.Bitmap(100, 100);
g = System.Drawing.Graphics.FromImage(bitmap);
//try
//{
System.Drawing.Font f = new System.Drawing.Font("Arial", 12);//测试结果是:如果系统没有安装此字体,会自动设置到一个默认字体,所以这里异常可能不会发出。 //}
//catch
//{
// throw new System.SystemException("操作系统中未安装Arial字体。");
//}
g.DrawString("验证码内部出错!", f, System.Drawing.Brushes.Red, 100, 100); }
this.Page.Response.Clear();
this.Page.Response.ContentType = "image/jpeg";
验证码控件使用方法_计算机软件及应用_IT/计算机_专业...页面的点击事件会触发验证,无需后台代码验证 一、...最容易使用的验证码控件... 38页 免费 验证码使用...
ASP.NET验证码控件(附详细用法)_理学_高等教育_教育专区。很实用的 .net 验证码控件 代码 大家看看验证码控件(附详细用法) 共享一款 ASP.NET 验证码控件(附详细...
在控件中,这些控件创 建了针对特定浏览器的代码,...最容易使用的验证码控件... 38页 免费 最容易使用...实验二 - 服务器控件及内... 6页 免费 5第五章...
Web 页面: Html 代码 1 2 3 4 <asp:Button ID...ASP.NET验证码控件(附详... 10页 免费 ...最容易使用的验证码控件... 38页 免费 最容易使用...
最新发布,验证码控件,绝对原创_其它考试_资格考试/认证_教育专区。今日推荐 180份文档 2014证券从业资格考试 2014证券资格证券交易高分突破试卷及答案 2014年证券考试...
.net中验证控件_计算机软件及应用_IT/计算机_专业资料。自带的验证控件及使用方法...你可以自己容易构造验证方式,我们先来 看看标准代码: <ASP:RegularExpression...
第10章[验证控件和正则表达式]理论课_计算机软件及应用_IT/计算机_专业资料。验证...或者VBScript来实现验证,需要编写大量的JavaScript代码, 使 用非常不方便;但是ASP...
输入验证控件 验证控件 5.4.1 5.4.2 5.4.3 5.4.4 验证控件及其作用 验证控件的公有成员 验证控件的用法 禁用数据验证 1 验证控件及其作用 ASP.NET验证...
代码如下: 页面加载时执行的事件过程代码如下: 页面加载时执行的事件过程代码如下...性进行比较验证,使用必须项验证控件 (RequiredFieldValidator)设置用户名及密码为...
看下列代码进行操作: 验证码 ...2014计算机一级WPS及基础... 2014年9月计算机三级软件... 【呕心推荐...最容易使用的验证码控件... 38页 免费 网络投票系统...
热门文档