C# Class CaptchaMVC6.CaptchaMiddleware

Show file Open project: heavenwing/CaptchaMVC6 Class Usage Examples

Public Properties

Property Type Description
ApplicationServices IServiceProvider

Public Methods

Method Description
CanOption ( string name, ISession session ) : bool

判断可选状态是否为真

CaptchaMiddleware ( RequestDelegate next, ICodeGenerator codeGenerator, IGraphicGenerator graphicGenerator ) : System
DisableOption ( string name, ISession session ) : void

禁用可选状态

EnableOption ( string name, ISession session ) : void

清除可选状态的值,以便启用可选判断

Invoke ( Microsoft.AspNet.Http.HttpContext context ) : System.Threading.Tasks.Task

Process an individual request.

Method Details

CanOption() public static method

判断可选状态是否为真
public static CanOption ( string name, ISession session ) : bool
name string
session ISession
return bool

CaptchaMiddleware() public method

public CaptchaMiddleware ( RequestDelegate next, ICodeGenerator codeGenerator, IGraphicGenerator graphicGenerator ) : System
next RequestDelegate
codeGenerator ICodeGenerator
graphicGenerator IGraphicGenerator
return System

DisableOption() public static method

禁用可选状态
public static DisableOption ( string name, ISession session ) : void
name string
session ISession
return void

EnableOption() public static method

清除可选状态的值,以便启用可选判断
public static EnableOption ( string name, ISession session ) : void
name string
session ISession
return void

Invoke() public method

Process an individual request.
public Invoke ( Microsoft.AspNet.Http.HttpContext context ) : System.Threading.Tasks.Task
context Microsoft.AspNet.Http.HttpContext
return System.Threading.Tasks.Task

Property Details

ApplicationServices public static property

because of ValidationAttribute can't get injection
public static IServiceProvider ApplicationServices
return IServiceProvider