Share via


SystemTypeName 函式

更新:2007 年 11 月

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

Public Function SystemTypeName(ByVal VbName As String) As String

參數

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

備註

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.

需求

命名空間 (Namespace)︰Microsoft.VisualBasic

**模組︰**Information

組件:Visual Basic Runtime Library (在 Microsoft.VisualBasic.dll 中)

請參閱

參考

資料型別摘要 (Visual Basic)

String 資料型別 (Visual Basic)

VbTypeName 函式