Connect to a message queue and sends a message to the queue. : Messaging « Windows « VB.Net Tutorial






Imports System
Imports System.Messaging

Public Class MyNewQueue
        Public Shared Sub Main()
            Dim myNewQueue As New MyNewQueue
            myNewQueue.SendMessage()
        End Sub
        Public Sub SendMessage()
            Dim myQueue As New MessageQueue(".\myQueue")
            If myQueue.Transactional = True Then
                Dim myTransaction As New MessageQueueTransaction
                myTransaction.Begin()
                myQueue.Send("My Message Data.", myTransaction)
                myTransaction.Commit()
            Else
                myQueue.Send("My Message Data.")
            End If
            Return
        End Sub
End Class








24.30.Messaging
24.30.1.Iterates through all the message queues in the network, examines the path for each queue.
24.30.2.Connect to a message queue and sends a message to the queue.