Is there anything already provided in the .NET framework or the Win32 API for parsing an MSMQ path? I simply need to get the destination computer’s network address from an MSMQ path string. I was hoping there would be a simple class similar to the SqlConnectionStringBuilder class, or something, but if there is, I can’t seem to find it. For instance:
Formatname:DIRECT=TCP:192.168.1.1\private$\MyQueueName–>192.168.1.1Formatname:DIRECT=OS:MyComputerName\private$\MyQueueName–>MyComputerName
I know I can parse if myself with the String methods or RegEx, but I was hoping there might be a tool that already properly supports all the variations of the MSMQ path syntax.
You can create a runtime callable wrapper around mqoa30.tlb
This can be found in system32 folder (or wow64)
Then you can create an instance of MSMQManagement object and call the Machine property.