MessageQueue.FormatName 属性
定义
获取“消息队列”在创建队列时生成的唯一队列名。Gets the unique queue name that Message Queuing generated at the time of the queue's creation.
public:
property System::String ^ FormatName { System::String ^ get(); };
[System.Messaging.MessagingDescription("MQ_FormatName")]
public string FormatName { get; }
[<System.Messaging.MessagingDescription("MQ_FormatName")>]
member this.FormatName : string
Public ReadOnly Property FormatName As String
属性值
队列的名称,该名称在网络上是唯一的。The name for the queue, which is unique on the network.
- 属性
例外
- 或 --or- 访问“消息队列”方法时出错。An error occurred when accessing a Message Queuing method.
示例
下面的代码示例显示消息队列属性的值 FormatName 。The following code example displays the value of a message queue's FormatName property.
// Display the value of the queue's FormatName property.
Console.WriteLine("MessageQueue.FormatName: {0}", queue.FormatName);
注解
FormatName属性包含队列的格式名。The FormatName property contains the format name of the queue. 消息队列使用格式名来标识要打开的队列以及如何访问它。Message Queuing uses the format name to identify which queue to open and how to access it. 与队列的大多数特征不同,格式名不是 "消息队列应用程序队列" 属性,因此无法通过 "消息队列" 管理工具进行访问。Unlike most of a queue's characteristics, the format name is not a Message Queuing application queue property, so you cannot access it through the Message Queuing management tool. 格式名称只是队列的唯一名称,消息队列在创建队列时生成,或者应用程序稍后生成。The format name is simply a unique name for the queue, which Message Queuing generates when it creates the queue or which the application generates later.
如果使用路径名语法指定路径 (例如 myComputer\myQueue) ,而不是在读取或写入队列时使用格式名语法,则使用) Active Directory 的主域控制器 (将在 Path 访问队列之前将转换为关联的 FormatName 。If you specify a path using the path name syntax (such as myComputer\myQueue) rather than using the format name syntax when you read or write to the queue, the primary domain controller (which uses Active Directory) translates the Path into the associated FormatName before accessing the queue. 如果你的应用程序脱机工作,则必须使用 format name 语法;否则,主域控制器将不可用于执行路径转换。If your application is working offline, you must use the format name syntax; otherwise, the primary domain controller will not be available to perform the path translation.
下表显示了此属性在各种工作组模式下是否可用。The following table shows whether this property is available in various Workgroup modes.
| 工作组模式Workgroup mode | 可用Available |
|---|---|
| 本地计算机Local computer | 是Yes |
| 本地计算机和直接格式名称Local computer and direct format name | 是Yes |
| 远程计算机Remote computer | 是Yes |
| 远程计算机和直接格式名称Remote computer and direct format name | 是Yes |