资源简介
很好的项目管理系统很好的项目管理系统很好的项目管理系统很好的项目管理系统
代码片段和文件信息
using System;
using System.Collections;
using FastSpring.ValueList;
using FastSpring.Web.base;
using FastSpring.Common.Files;
using FastSpring.Common;
using System.Drawing;
using System.Web.UI;
namespace FastSpring.Web
{
public partial class CheckImage : Page
{
protected void Page_Load(object sender EventArgs e)
{
string checkCode = StrTools.GetCheckCodeString(5);
this.SaveSession(checkCode);
CreateImage(checkCode);
}
private void SaveSession(string checkCode)
{
this.Session[WebHelper.SESSION_CHECKIMAGE] = checkCode;
}
private void CreateImage(string checkCode)
{
int iwidth = (int)(checkCode.Length * 15);
System.Drawing.Bitmap image = new System.Drawing.Bitmap(iwidth 25);
Graphics g = Graphics.FromImage(image);
g.Clear(Color.White);
//定义颜色
Color[] c = { Color.Black Color.Red Color.DarkBlue Color.Green Color.Orange Color.Brown Color.DarkCyan Color.Purple };
//定义字体
string[] font = {“Verdana““Microsoft Sans Serif““Comic Sans MS““Arial““宋体“};
Random rand = new Random();
//随机输出噪点
for (int i = 0; i < 50; i++)
{
int x = rand.Next(image.Width);
int y = rand.Next(image.Height);
g.DrawRectangle(new Pen(Color.LightGray 0) x y 1 1);
}
//输出不同字体和颜色的验证码字符
for (int i = 0; i < checkCode.Length; i++)
{
int cindex = rand.Next(7);
int findex = rand.Next(5);
Font f = new System.Drawing.Font(font[findex] 10 System.Drawing.Fontstyle.Bold);
Brush b = new System.Drawing.SolidBrush(c[cindex]);
int ii = 4;
if ((i + 1) % 2 == 0)
{
ii = 2;
}
g.DrawString(checkCode.Substring(i 1) f b 3 + (i * 12) ii);
}
//画一个边框
g.DrawRectangle(new Pen(Color.Black 0) 0 0 image.Width - 1 image.Height - 1);
//输出到浏览器
System.IO.MemoryStream ms = new System.IO.MemoryStream();
image.Save(ms System.Drawing.Imaging.ImageFormat.Jpeg);
Response.ClearContent();
Response.ContentType = “image/Jpeg“;
Response.BinaryWrite(ms.ToArray());
g.Dispose();
image.Dispose();
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\_source
..AD... 0 2008-05-21 14:34 WebRoot\Html\Images\Admin
..AD... 0 2008-05-21 14:33 WebRoot\Html\sc
..AD... 0 2008-05-21 14:34 WebRoot\App_Data
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\plugins\autogrow
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\css\behaviors
..AD... 0 2008-05-21 15:19 WebRoot\Bin
目录 0 2008-05-21 14:34 WebRoot\Cache
..AD... 0 2008-05-21 15:18 WebRoot\Html\Images\calendar
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\_source\classes
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\_source\commandclasses
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\dialog\common
..AD... 0 2008-05-21 14:33 WebRoot\SystemAdmin\Core
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\css
..AD... 0 2008-05-21 14:34 WebRoot\Html\CSS
目录 0 2008-05-21 15:28 DbInstall\Data
目录 0 2008-05-26 10:35 DB_51aspx
目录 0 2008-05-27 00:21 DbInstall
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\skins\default
..AD... 0 2008-05-21 14:33 WebRoot\VDCSeditor\common\sc
..AD... 0 2008-05-21 14:34 WebRoot\Html\Images\edit_files
..AD... 0 2008-05-21 15:18 WebRoot\Html\Images\edit_smiles
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\dialog\fck_about
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\dialog\fck_docprops
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\dialog\fck_flash
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\dialog\fck_image
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\dialog\fck_li
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\dialog\fck_select
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\dialog\fck_spellerpages
..AD... 0 2008-05-21 14:34 WebRoot\FCKeditor\editor\dialog\fck_universalkey
............此处省略1088个文件信息
- 上一篇:asp动态网站计算机系网站
- 下一篇:asp考勤管理系统85840
评论
共有 条评论