Read-only. The ModifyTime property indicates when the public queue's properties in the information store were last updated.
Type: | Date Variant |
Run time: | read-only |
object.ModifyTime
Syntax Element | Description |
object | Queue information (MSMQQueueInfo) object that defines the queue. |
Date when the queue properties were last updated (includes when the queue was created and the last time Update was called).
To read this property, the application must first call the MSMQQueueInfo object's Refresh method. Although MSMQ updates MQIS when the queue is created and when Update is called, the ModifyTime property is not updated until Refresh is called.
The returned value for this property can be manipulated using standard Microsoft® Visual Basic® date and time functions such as Date$, and Time$. For descriptions of Visual Basic functions, see the Visual Basic documentation.
When ModifyTime is displayed, Visual Basic will automatically convert the parameter's value to the local system time and system date.
The ModifyTime property can be used when making a query (see example below).
This example uses the ModifyTime and RelModifyTime parameters of LookupQueue to locate all the public queues that have been modified in the last 10 minutes. To locate the queues, MSMQ compares the date specified by the ModifyTime parameter with the date of each queue's ModifyTime property.
To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form, and then run the example and click the form. Run the example once, then wait ten minutes and run the example again with a new PathName. The queue created by the first pass will not be found on the second pass.
Dim query As New MSMQQuery Dim qinfos As MSMQQueueInfos Dim qinfoNew As MSMQQueueInfo Dim qinfoDest As MSMQQueueInfo Private Sub Form_Click() Set qinfoNew = New MSMQQueueInfo qinfoNew.PathName = ".\ModifyTest1" qinfoNew.Label = "Test Queue" qinfoNew.Create '********************** ' Locate public queues '********************** dateLast = DateAdd("n", -10, Now) Set qinfos = query.LookupQueue(ModifyTime:=dateLast, RelModifyTime:=REL_GT) qinfos.Reset '********************************** ' Display public queues modified in ' last 10 minutes. '********************************** Set qinfoDest = qinfos.Next cQueue = 0 'Counter for number of queues found. While Not qinfoDest Is Nothing MsgBox "The properties of this queue (" + qinfoDest.FormatName + ") were modified in the last ten minutes." cQueue = cQueue + 1 Set qinfoDest = qinfos.Next Wend MsgBox "The total public queues found were: " + CStr(cQueue) End Sub
Create, FormatName, Label, LookupQueue, MSMQQuery, MSMQQueueInfo, MSMQQueueInfos, Next, PathName, Reset