C# Class LightFramework.Web.ImageValidCodeHelper

生成图片验证码的类。
Afficher le fichier Open project: xianrendzw/LightFramework.Net

Méthodes publiques

Méthode Description
GenValidateCode ( ) : string

生成默认长度(5位字符)的验证码

GenValidateCode ( int len ) : string

生成指定长度的验证码

GenValidateCode ( int len, bool isOnlyNumber ) : string

生成指定长度的验证码

OutputValidateCodeImage ( string code, int width, int height, Color bgcolor, int textcolor ) : byte[]

生成验证码图片

OutputValidateCodeImage ( System response, string validateCode ) : void

输出验证码图片,默认图片宽度是80,高度30,文字大小是18号

OutputValidateCodeImage ( System response, string validateCode, float fontSize ) : void

输出验证码图片,默认图片宽度是80,高度30,文字大小是18号

OutputValidateCodeImage ( System response, string validateCode, float fontSize, int height ) : void

输出验证码图片

OutputValidateCodeImage ( System response, string validateCode, float fontSize, int width, int height ) : void

输出验证码图片

OutputValidateCodeImage ( System response, string validateCode, float fontSize, int width, int height, Color bgcolor, Color txcolor, FontStyle fontStyle, string contentType ) : void

输出验证码图片,支持png和jpeg

Private Methods

Méthode Description
Next ( int max ) : int

获得下一个随机数

Next ( int min, int max ) : int

获得下一个随机数

Method Details

GenValidateCode() public static méthode

生成默认长度(5位字符)的验证码
public static GenValidateCode ( ) : string
Résultat string

GenValidateCode() public static méthode

生成指定长度的验证码
public static GenValidateCode ( int len ) : string
len int 验证码的长度
Résultat string

GenValidateCode() public static méthode

生成指定长度的验证码
public static GenValidateCode ( int len, bool isOnlyNumber ) : string
len int 验证码的长度
isOnlyNumber bool
Résultat string

OutputValidateCodeImage() public static méthode

生成验证码图片
public static OutputValidateCodeImage ( string code, int width, int height, Color bgcolor, int textcolor ) : byte[]
code string 要显示的验证码
width int 宽度
height int 高度
bgcolor Color 背景色
textcolor int 文字颜色
Résultat byte[]

OutputValidateCodeImage() public static méthode

输出验证码图片,默认图片宽度是80,高度30,文字大小是18号
public static OutputValidateCodeImage ( System response, string validateCode ) : void
response System HttpResponse对象
validateCode string 验证码字符串
Résultat void

OutputValidateCodeImage() public static méthode

输出验证码图片,默认图片宽度是80,高度30,文字大小是18号
public static OutputValidateCodeImage ( System response, string validateCode, float fontSize ) : void
response System HttpResponse对象
validateCode string 验证码字符串
fontSize float 字体大小
Résultat void

OutputValidateCodeImage() public static méthode

输出验证码图片
public static OutputValidateCodeImage ( System response, string validateCode, float fontSize, int height ) : void
response System HttpResponse对象
validateCode string 验证码字符串
fontSize float 字体大小
height int 图片高度
Résultat void

OutputValidateCodeImage() public static méthode

输出验证码图片
public static OutputValidateCodeImage ( System response, string validateCode, float fontSize, int width, int height ) : void
response System HttpResponse对象
validateCode string 验证码字符串
fontSize float 字体大小
width int 图片宽度
height int 图片高度
Résultat void

OutputValidateCodeImage() public static méthode

输出验证码图片,支持png和jpeg
public static OutputValidateCodeImage ( System response, string validateCode, float fontSize, int width, int height, Color bgcolor, Color txcolor, FontStyle fontStyle, string contentType ) : void
response System HttpResponse对象
validateCode string 验证码字符串
fontSize float 字体大小
width int 图片宽度
height int 图片高度
bgcolor Color
txcolor Color
fontStyle FontStyle
contentType string
Résultat void