Information.SystemTypeName(String) 方法

定義

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

public:
 static System::String ^ SystemTypeName(System::String ^ VbName);
public static string SystemTypeName(string VbName);
static member SystemTypeName : string -> string
Public Function SystemTypeName (VbName As String) As String

參數

VbName
String

必須的。 一個包含 Visual Basic 型別名稱的 String 變數。

傳回

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

範例

以下範例使用該 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.

備註

SystemTypeName 會回傳與 Visual Basic 型別名稱對應的完全限定通用語言執行時(CLR)型別名稱。 例如,若 VbName 包含「Date」,則 SystemTypeName 回傳「System.DateTime」。 若 SystemTypeName 不識別 的 VbName值,則回傳 Nothing (非字串「Nothing」)。

適用於

另請參閱