Assembly.FullName 属性

获取程序集的显示名称。

**命名空间:**System.Reflection
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
Public Overridable ReadOnly Property FullName As String
用法
Dim instance As Assembly
Dim value As String

value = instance.FullName
public virtual string FullName { get; }
public:
virtual property String^ FullName {
    String^ get ();
}
/** @property */
public String get_FullName ()
public function get FullName () : String

属性值

程序集的显示名称。

备注

有关程序集显示名称格式的说明,请参见 AssemblyName

提示

不建议您自己编写代码来分析显示名称。而是建议您将显示名称传递给 AssemblyName 构造函数,该构造函数分析显示名称并填充新 AssemblyName 的相应字段。

示例

下面的示例检索程序集的全名。

    Dim SampleAssembly As [Assembly]
    ' Instantiate a target object.
    Dim Integer1 As New Int32()
    Dim Type1 As Type
    ' Set the Type instance to the target class type.
    Type1 = Integer1.GetType()
    ' Instantiate an Assembly class to the assembly housing the Integer type.  
    SampleAssembly = [Assembly].GetAssembly(Integer1.GetType())
    ' Write the display name of assembly including base name and version.
    Console.WriteLine(("FullName=" + SampleAssembly.FullName))
End Sub 'Snippet2
Assembly SampleAssembly;
// Instantiate a target object.
Int32 Integer1 = new Int32();
Type Type1;
// Set the Type instance to the target class type.
Type1 = Integer1.GetType();
// Instantiate an Assembly class to the assembly housing the Integer type.  
SampleAssembly = Assembly.GetAssembly(Integer1.GetType());
// Write the display name of assembly including base name and version.
Console.WriteLine("FullName=" + SampleAssembly.FullName);
Assembly^ SampleAssembly;
// Instantiate a target object.
Int32 Integer1(0);
Type^ Type1;
// Set the Type instance to the target class type.
Type1 = Integer1.GetType();
// Instantiate an Assembly class to the assembly housing the Integer type.  
SampleAssembly = Assembly::GetAssembly( Integer1.GetType() );
// Write the display name of assembly including base name and version.
Console::WriteLine( "FullName= {0}", SampleAssembly->FullName );
var SampleAssembly : Assembly;
// Instantiate a target object.
var Integer1 : Int32 = 0;
var Type1 : Type;
// Set the Type instance to the target class type.
Type1 = Integer1.GetType();
// Instantiate an Assembly class to the assembly housing the Integer type.  
SampleAssembly = Assembly.GetAssembly(Integer1.GetType());
// Write the display name of assembly including base name and version.
Console.WriteLine("FullName=" + SampleAssembly.FullName);

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

Assembly 类
Assembly 成员
System.Reflection 命名空间

其他资源

指定完全限定的类型名称
指定完全限定的类型名称