다음을 통해 공유


PrintQueue.Name 속성

정의

인쇄 큐의 이름을 가져오거나 설정합니다.

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public:
 property System::String ^ Name { System::String ^ get(); };
public override sealed string Name { get; set; }
public override sealed string Name { get; }
member this.Name : string with get, set
member this.Name : string
Public Overrides NotOverridable Property Name As String
Public Overrides NotOverridable ReadOnly Property Name As String

속성 값

인쇄 대기열의 이름입니다.

예제

다음 예제에서는 사용 가능한 인쇄 큐의 하위 집합을 나열 하는이 속성을 사용 하는 방법을 보여 줍니다.

// Specify that the list will contain only the print queues that are installed as local and are shared
array<System::Printing::EnumeratedPrintQueueTypes>^ enumerationFlags = {EnumeratedPrintQueueTypes::Local,EnumeratedPrintQueueTypes::Shared};

LocalPrintServer^ printServer = gcnew LocalPrintServer();

//Use the enumerationFlags to filter out unwanted print queues
PrintQueueCollection^ printQueuesOnLocalServer = printServer->GetPrintQueues(enumerationFlags);

Console::WriteLine("These are your shared, local print queues:\n\n");

for each (PrintQueue^ printer in printQueuesOnLocalServer)
{
   Console::WriteLine("\tThe shared printer " + printer->Name + " is located at " + printer->Location + "\n");
}
Console::WriteLine("Press enter to continue.");
Console::ReadLine();
// Specify that the list will contain only the print queues that are installed as local and are shared
EnumeratedPrintQueueTypes[] enumerationFlags = {EnumeratedPrintQueueTypes.Local,
                                                EnumeratedPrintQueueTypes.Shared};

LocalPrintServer printServer = new LocalPrintServer();

//Use the enumerationFlags to filter out unwanted print queues
PrintQueueCollection printQueuesOnLocalServer = printServer.GetPrintQueues(enumerationFlags);

Console.WriteLine("These are your shared, local print queues:\n\n");

foreach (PrintQueue printer in printQueuesOnLocalServer)
{
    Console.WriteLine("\tThe shared printer " + printer.Name + " is located at " + printer.Location + "\n");
}
Console.WriteLine("Press enter to continue.");
Console.ReadLine();
' Specify that the list will contain only the print queues that are installed as local and are shared
Dim enumerationFlags() As EnumeratedPrintQueueTypes = {EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Shared}

Dim printServer As New LocalPrintServer()

'Use the enumerationFlags to filter out unwanted print queues
Dim printQueuesOnLocalServer As PrintQueueCollection = printServer.GetPrintQueues(enumerationFlags)

Console.WriteLine("These are your shared, local print queues:" & vbLf & vbLf)

For Each printer As PrintQueue In printQueuesOnLocalServer
    Console.WriteLine(vbTab & "The shared printer " & printer.Name & " is located at " & printer.Location & vbLf)
Next printer
Console.WriteLine("Press enter to continue.")
Console.ReadLine()

설명

PrintQueue 개체에는 읽기 전용 FullName 속성과 쓰기 가능한 속성도 있습니다ShareName.

로컬 인쇄 서버 Name 의 큐의 경우 및 FullName 는 동일합니다.

적용 대상