MessageProperties.TryGetValue(String, Object) 方法

定义

确定 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 * obj -> bool
override this.TryGetValue : string * obj -> bool
Public Function TryGetValue (name As String, ByRef value As Object) As Boolean

参数

name
String

要查找的元素的名称。The name of the element to locate.

value
Object

所找到元素的值。The value of the found element.

返回

Boolean

如果 true 包含具有指定 MessageProperties 的元素,则为 name;否则为 falsetrue if the MessageProperties contains an element with the specified name; otherwise, false.

适用于