. , , , .. .
C# ( ) .NET -. Type System . .
Type : , , , , , . , Type (), .
Type.
Type
Type :
- ;
- (Value types);
- ;
- ;
- ;
- ().
Type, , :
- Object.GetType Type, ;
- GetType Type, , ;
- Module. GetTypes, Module. GetType, Module. FindTypes Type, , . GetTypes , ;
- FindInterfaces , ;
- GetElementType Type, ;
- GetInterfaces GetInterface Type, , ;
- GetTypeArray Type, , ;
- GetTypeFromProgID GetTypeFromCLSID Type, ProgID CLSID ( );
- GetTypeFromHandle Type, ( );
- typeof Type .
- , . . . try - catch.
:
try
{
Type tp = Type.GetType(s); // s
|
|
Console.WriteLine(" : {0}",tp.FullName);
}
catch (System.NullReferenceException)
{
Console.WriteLine(" ");
}
Type , :
- FullName - ;
- IsClass - , ;
- IsAbstract - , ;
- IsNestedPublic - , ;
- IsPublic - , ;
- IsNotPublic - , ;
- IsSealed - , ( );
- IsArray - , ;
- GUID - GUID, ( Windows).
- IsNestedAssembly - , ;
- Module - (DLL) ;
- Namespace - , ;
- IsByRef , , Assembly .