Message.BodyType 속성

정의

메시지 본문에 포함되는 데이터 형식을 가져오거나 설정합니다.

public:
 property int BodyType { int get(); void set(int value); };
[System.Messaging.MessagingDescription("MsgBodyType")]
public int BodyType { get; set; }
[<System.Messaging.MessagingDescription("MsgBodyType")>]
member this.BodyType : int with get, set
Public Property BodyType As Integer

속성 값

문자열, 날짜, 통화 또는 숫자 등과 같은 메시지 본문의 실제 형식입니다.

특성

예외

메시지 큐가 Body 속성을 무시하도록 필터링된 경우

예제

다음 코드 예제에서는 메시지의 값을 표시 BodyType 속성입니다.

설명

Serialize 된 스트림 또는 개체로 메시지 큐 본문 콘텐츠를 인식합니다. 합니다 BodyType 속성 내에서 개체의 유형을 나타냅니다는 Body 메시지의 속성입니다.

XmlMessageFormatter 메시지 본문에서 네이티브 형식과 개체 간에 바인딩을 수행 합니다. 사용 하는 경우는 XmlMessageFormatter, 포맷터 집합을 BodyType 속성이 있습니다.

다른 포맷터는 또한 다음 C# 코드에 표시 된 것 처럼 바인딩 기능을 제공할 수 있습니다.

message.Formatter = new ActiveXMessageFormatter();  
object myObject message.Body;  
if (myObject is string) {  
}  
if (myObject is int) {  
}  
if (myObject is float) {  
}  

적용 대상

추가 정보