共用方式為


BindConverter.TryConvertTo<T>(Object, CultureInfo, T) 方法

定義

嘗試將值轉換成 類型的 T 值。

public:
generic <typename T>
 static bool TryConvertTo(System::Object ^ obj, System::Globalization::CultureInfo ^ culture, [Runtime::InteropServices::Out] T % value);
public static bool TryConvertTo<T> (object obj, System.Globalization.CultureInfo culture, out T value);
public static bool TryConvertTo<T> (object? obj, System.Globalization.CultureInfo? culture, out T value);
static member TryConvertTo : obj * System.Globalization.CultureInfo * 'T -> bool
Public Shared Function TryConvertTo(Of T) (obj As Object, culture As CultureInfo, ByRef value As T) As Boolean

類型參數

T

參數

obj
Object

要轉換的物件。

culture
CultureInfo

CultureInfo要用於轉換的 。

value
T

轉換的值。

傳回

true 如果轉換成功,則為 ,否則 false 為 。

適用於