C#中的属性是什么 [英] what are attributes in c#

查看:136
本文介绍了C#中的属性是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是属性,为什么我们要使用属性
请提出一些简单而基本的网址

Thanks

What are attributes , Why we are using Attributes
please suggest some simple and basic urls

thanks

推荐答案

属性定义与类,结构,方法等相关的其他信息(元数据). 例如,您可以定义一个属性,该属性确定类将显示的按钮的类型.

属性是在方括号之间指定的,在它们所应用的项目之前.因此,属性不是类的成员.而是,属性指定附加到项目的补充信息.

请参阅此以获取更多详细信息:

http://msdn.microsoft.com/en-us/library/aa287992%28v = vs.71%29.aspx [ ^ ]

希望这会有所帮助:)
An attribute defines additional information (metadata) that is associated with a class, structure, method, and so on. For example you might define an attribute that determines the type of button that a class will display.

Attributes are specified between square brackets, preceding the item to which they apply. Thus, an attribute is not a member of a class. Rather, an attribute specifies supplemental information that is attached to an item.

refer this for more details:

http://msdn.microsoft.com/en-us/library/aa287992%28v=vs.71%29.aspx[^]

hope this helps :)


这篇关于C#中的属性是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆