C# 自我学习总结

AttributeUsage : from  AttributeUsage

AttributeUsage 类的作用就是帮助我们控制定制特性的使用。其实AttributeUsage类就是描述了一个定制特性如和被使用。

  C# AttributeUsage的使用要明白: [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]

  AttributeUsage有三个属性,我们可以把它放置在定制属性前面。第一个属性是:

  ◆ValidOn 
   
  通过这个属性,我们能够定义定制特性应该在何种程序实体前放置。一个属性可以被放置的所有程序实体在AttributeTargets enumerator中列出。通过OR操作我们可以把若干个AttributeTargets值组合起来。

  ◆AllowMultiple 
   
  这个属性标记了我们的定制特性能否被重复放置在同一个程序实体前多次。

  ◆Inherited 
   

  我们可以使用这个属性来控制定制特性的继承规则。它标记了我们的特性能否被继承。

HandleErrorAttribute: from HandleErrorAttribute

ExceptionContext : from ExceptionContext

HttpException : from HttpException

JsonResult : from  JsonResult

HandleErrorInfo : from HandleErrorInfo

HttpResponse : from HttpResponse

AuthorizeAttribute : from AuthorizeAttribute

AuthorizationContext : from AuthorizationContext

AllowAnonymousAttribute : from AllowAnonymousAttribute

FormsAuthentication : from FormsAuthentication

ModelState : from ModelState

FormsAuthentication.SetAuthCookie : from FormsAuthentication.SetAuthCookie

SelectListItem : from SelectListItem

SelectList : from SelectList

ViewBag : from ViewBag

AreaRegistration : from AreaRegistration

NetworkCredential : from NetworkCredential

FtpWebRequest : from FtpWebRequest

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值