asp.net技术内幕的书配源码
源代码在线查看: messagepriorities.aspx
Sub Page_Load
Dim mqMessages As MessageQueue
Dim mqMessage As Message
If Not MessageQueue.Exists( ".\myQueue" ) Then
MessageQueue.Create( ".\myQueue" )
End If
mqMessages = New MessageQueue( ".\myQueue" )
' Send Message 1
mqMessage = New Message()
mqMessage.Label = "Message 1"
mqMessage.Body = "This is message 1"
mqMessage.Priority = MessagePriority.Normal
mqMessages.Send( mqMessage )
' Send Message 2
mqMessage = New Message()
mqMessage.Label = "Message 2"
mqMessage.Body = "This is message 2"
mqMessage.Priority = MessagePriority.Lowest
mqMessages.Send( mqMessage )
' Send Message 3
mqMessage = New Message()
mqMessage.Label = "Message 3"
mqMessage.Body = "This is message 3"
mqMessage.Priority = MessagePriority.Highest
mqMessages.Send( mqMessage )
End Sub
MessagePriorities.aspx
Messages Sent!