MessageProperties.TryGetValue(String, Object) MessageProperties.TryGetValue(String, Object) MessageProperties.TryGetValue(String, Object) MessageProperties.TryGetValue(String, Object) Method

定義

判斷 MessageProperties 是否包含特定名稱,並且擷取其值。Determines whether the MessageProperties contains a specific name, and retrieves its value.

public:
 virtual bool TryGetValue(System::String ^ name, [Runtime::InteropServices::Out] System::Object ^ % value);
public bool TryGetValue (string name, out object value);
abstract member TryGetValue : string *  -> bool
override this.TryGetValue : string *  -> bool
Public Function TryGetValue (name As String, ByRef value As Object) As Boolean

參數

name
String String String String

要尋找之項目的名稱。The name of the element to locate.

value
Object Object Object Object

找到之項目的值。The value of the found element.

傳回

如果 true 包含具有指定 MessageProperties 的項目,則為 name,否則為 falsetrue if the MessageProperties contains an element with the specified name; otherwise, false.

適用於