授权验证,比如登陆验证 1.自定义属性继承AuthorizeAttribute 2.重写OnAuthorization方法 3.通过AllowAnonymousAttribute特性处理无需授权的Action或者Controller 实现代码: public class MyAuthorizeAttribute : AuthorizeAttribute { CookieService MyCookie = new CookieService(); private long _UserCode =