Eg:- Serializable is an Attribute.
Usage of Attributes in VB.Net(Sample):
<Serializable()> _
Public Class Employee
Public Name As String
Public Designation As String
End Class
Usage of Attributes in C#.Net(Sample):
[Serializable()]
public class Employee
{
public string Name;
public string Designation;
}
Note: All the attributes are classes that derived from System.Attribute class.
.Net framework has a lot of attributes that can be used for controlling XML serialization, Web services, COM interoperability etc.. And .Net provides the oppertunity to create custom attributes.