SecurityTokenRequirement.TryGetProperty<TValue>(String, TValue) 方法

定义

获取当前 SecurityTokenRequirement 实例的指定属性。

public:
generic <typename TValue>
 bool TryGetProperty(System::String ^ propertyName, [Runtime::InteropServices::Out] TValue % result);
public bool TryGetProperty<TValue>(string propertyName, out TValue result);
member this.TryGetProperty : string * 'Value -> bool
Public Function TryGetProperty(Of TValue) (propertyName As String, ByRef result As TValue) As Boolean

类型参数

TValue

参数中 result 要返回的属性的类型。

参数

propertyName
String

要获取的属性的名称。

result
TValue

属性中指定的 propertyName 属性的值。

返回

true Properties如果属性包含属性中指定的propertyName属性的属性值,则为 否则为 false

例外

属性具有参数中指定的 propertyName 名称,但它的类型与参数中指定的 TValue 类型不同。

注解

若要获取指定属性的属性值并验证属性值是否可以设置为参数中指定的 TValue 类型,请调用 GetProperty<TValue>(String) 该方法。

适用于