This documentation is archived and is not being maintained.
PrintQueue::Location Property
Visual Studio 2010
Gets or sets the printer's physical location.
Assembly: System.Printing (in System.Printing.dll)
The following example shows how to use this property to list a subset of available print queues.
// 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();
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: