Any application can use the added information provided by an attribute. In general, there are two types of attributes in VB .NET: predefined and custom. A predefined attribute is used by the .NET Framework itself. You can use the same techniques in your own applications with custom attributes.
Here's just a few of the predefined attributes taken from Microsoft's documentation. Notice that a recommended coding practice is to create an attribute name by dropping the trailing string "Attribute".
COMClassAttribute Class
Indicates to the compiler that the class should be exposed as a COM object. Specific to Visual Basic .NET.
VBFixedStringAttribute Class
Specifies the size of a fixed-length string in a structure for use with file input and output functions. Specific to Visual Basic .NET.
VBFixedArrayAttribute Class
Specifies the size of a fixed array in a structure for use with file input and output functions. Specific to Visual Basic .NET.
WebMethodAttribute Class
Makes a method callable using the SOAP protocol. Used in XML Web services.
SerializableAttribute Class Indicates that a class can be serialized.
MarshalAsAttribute Class
Determines how a parameter should be marshaled between the managed code of Visual Basic .NET and unmanaged code such as a Windows API. Used by the common language runtime.
AttributeUsageAttribute Class
Specifies how an attribute can be used.
DllImportAttribute Class Indicates that the attributed method is implemented as an export from an unmanaged DLL.
The three attributes that are specific to Visual Basic .NET are: COMClassAttribute, VBFixedStringAttribute, and VBFixedArrayAttribute.
Next page >
An Example: The Predefined VBFixedString Attribute > Page
1,
2,
3,
4