共用方式為


Information.SystemTypeName 方法

傳回 String 值,其中包含某個變數的系統資料型別名稱。

命名空間: Microsoft.VisualBasic
組件: Microsoft.VisualBasic (在 microsoft.visualbasic.dll 中)

語法

'宣告
Public Shared Function SystemTypeName ( _
    VbName As String _
) As String
'用途
Dim VbName As String
Dim returnValue As String

returnValue = Information.SystemTypeName(VbName)
public static string SystemTypeName (
    string VbName
)
public:
static String^ SystemTypeName (
    String^ VbName
)
public static String SystemTypeName (
    String VbName
)
public static function SystemTypeName (
    VbName : String
) : String

參數

  • VbName
    必要項。String 變數,包含 Visual Basic 型別名稱。

傳回值

傳回 String 值,其中包含某個變數的系統資料型別名稱。

備註

如需詳細資訊,請參閱 Visual Basic 的主題 SystemTypeName 函式

SystemTypeName 傳回與 Visual Basic 型別名稱對應的完整 Common Language Runtime (CLR) 型別名稱。例如,如果 VbName 包含 "Date",則 SystemTypeName 會傳回 "System.DateTime"。如果 SystemTypeName 無法辨識 VbName 的值,則它會傳回 Nothing (而非 "Nothing" 字串)。

範例

下列範例會使用 SystemTypeName 函式,傳回幾個變數的資料型別名稱。

Dim vbLongName As String = "Long"
Dim vbDateName As String = "Date"
Dim vbBadName As String = "Number"
Dim testSysName As String
testSysName = SystemTypeName(vbLongName)
' The preceding call returns "System.Int64".
testSysName = SystemTypeName(vbDateName)
' The preceding call returns "System.DateTime".
testSysName = SystemTypeName(vbBadName)
' The preceding call returns Nothing.

平台

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

請參閱

參考

Information 類別
Information 成員
Microsoft.VisualBasic 命名空間

其他資源

SystemTypeName 函式
資料型別摘要 (Visual Basic)
String 資料型別 (Visual Basic)
VbTypeName 函式