using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Imaging;
namespace Tyog.admin.html
{
public partial class Vcode : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Vcode v = new Vcode();
string code = v.CreateVerifyCode(); //取随机码
v.CreateImageOnPage(code, this.Context); // 输出图片
Session["CheckCode"] = code;
}
#region 验证码长度(默认6个验证码的长度)
int length = 4;
public int Length
{
get { return length; }
set { length = value; }
}
#endregion
#region 验证码字体大小(为了显示扭曲效果,默认40像素,可以自行修改)
int fontSize = 40;
public int FontSize
{
get { return fontSize; }
set { fontSize = value; }
}
#endregion
#region 边框补(默认1像素)
int padding = 2;
public int Padding
{
get { return padding; }
set { padding = value; }