MessageQueue.FormatName 屬性


取得訊息佇列在佇列建立時產生的唯一佇列名稱。Gets the unique queue name that Message Queuing generated at the time of the queue's creation.

 property System::String ^ FormatName { System::String ^ get(); };
public string FormatName { get; }
member this.FormatName : string
Public ReadOnly Property FormatName As String



在網路上唯一的佇列名稱。The name for the queue, which is unique on the network.



Path 未設定。The Path is not set.

-或--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. 如果您的應用程式離線工作,則必須使用格式名稱語法;否則,將無法使用網域主控站來執行路徑轉譯。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