Information.SystemTypeName(String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回 String 值,其中包含某個變數的系統資料類型名稱。
public:
static System::String ^ SystemTypeName(System::String ^ VbName);
public static string? SystemTypeName (string? VbName);
public static string SystemTypeName (string VbName);
static member SystemTypeName : string -> string
Public Function SystemTypeName (VbName As String) As String
參數
- VbName
- String
必要。
String 變數,包含 Visual Basic 類型名稱。
傳回
傳回 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 類型名稱對應的完整 Common Language Runtime (CLR) 類型名稱。 例如,如果 VbName 包含 「Date」 SystemTypeName 則會傳回 「System.DateTime」。。 如果 SystemTypeName 無法辨識 的值 VbName,它會傳回 Nothing (不是字串 “Nothing”) 。