NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Message.Label

Gets or sets the message label.

[Visual Basic]
Overridable Public Property Label As String
[C#]
public string Label {virtual get; virtual set;}
[C++]
public: __property virtual String* get_Label();
public: __property virtual void set_Label(String*);
[JScript]
public function get Label() : String;
public function set Label(String);

Property Value

The label of the message. The default is an empty string ("").

Remarks

Label provides access to the Label property of the Message Queuing MSMQMessage object.

Example [Visual Basic]

The following example creates an empty message. The example populates the Message with a string Body, sets the Label property, and then sends the message to a queue. It assumes there is a queue on the computer "myComputer" with the name "myQueue".

Import the System.Messaging namespace for this example.

[Visual Basic]

Private Sub CreateMessage()
    'Declare a message and message queue
    Dim msg As Message
    Dim mq As MessageQueue
    
    'Instantiate an empty message object
    msg = New Message
   
    'Instantiate a new MessageQueue object
    mq = New MessageQueue("myComputer\myQueue")

    'Set selected message properties.
    msg.Label = "My Message"
    msg.Body = "New Message Body"
    'Send the message to the queue.
    mq.Send(msg)
End Sub

See Also

Message Class | Message Members | System.Messaging Namespace