2个回答
展开全部
在MSDN找到的,不知道可以用不,没测试过,呵呵
获取打印服务器承载的打印队列的集合。
命名空间: System.Printing
程序集: System.Printing(在 System.Printing.dll 中)
语法
Visual Basic(声明)
Public Function GetPrintQueues As PrintQueueCollection
Visual Basic(用法)
Dim instance As PrintServer
Dim returnValue As PrintQueueCollection
returnValue = instance.GetPrintQueues()
C#
public PrintQueueCollection GetPrintQueues()
Visual C++
public:
PrintQueueCollection^ GetPrintQueues()
J#
public PrintQueueCollection GetPrintQueues()
JScript
public function GetPrintQueues() : PrintQueueCollection
返回值
类型:System.Printing..::.PrintQueueCollection
打印服务器上的打印队列的 PrintQueueCollection。
示例
下面的示例演示如何使用此方法列出 PrintServer 承载的打印队列。
C# 复制代码
// Create a PrintServer
// "theServer" must be a print server to which the user has full print access.
PrintServer myPrintServer = new PrintServer(@"\\theServer");
// List the print server's queues
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
String printQueueNames = "My Print Queues:\n\n";
foreach (PrintQueue pq in myPrintQueues)
{
printQueueNames += "\t" + pq.Name + "\n";
}
Console.WriteLine(printQueueNames);
Console.WriteLine("\nPress Return to continue.");
Console.ReadLine();
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.5、3.0 SP1、3.0
获取打印服务器承载的打印队列的集合。
命名空间: System.Printing
程序集: System.Printing(在 System.Printing.dll 中)
语法
Visual Basic(声明)
Public Function GetPrintQueues As PrintQueueCollection
Visual Basic(用法)
Dim instance As PrintServer
Dim returnValue As PrintQueueCollection
returnValue = instance.GetPrintQueues()
C#
public PrintQueueCollection GetPrintQueues()
Visual C++
public:
PrintQueueCollection^ GetPrintQueues()
J#
public PrintQueueCollection GetPrintQueues()
JScript
public function GetPrintQueues() : PrintQueueCollection
返回值
类型:System.Printing..::.PrintQueueCollection
打印服务器上的打印队列的 PrintQueueCollection。
示例
下面的示例演示如何使用此方法列出 PrintServer 承载的打印队列。
C# 复制代码
// Create a PrintServer
// "theServer" must be a print server to which the user has full print access.
PrintServer myPrintServer = new PrintServer(@"\\theServer");
// List the print server's queues
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
String printQueueNames = "My Print Queues:\n\n";
foreach (PrintQueue pq in myPrintQueues)
{
printQueueNames += "\t" + pq.Name + "\n";
}
Console.WriteLine(printQueueNames);
Console.WriteLine("\nPress Return to continue.");
Console.ReadLine();
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.5、3.0 SP1、3.0
参考资料: MSDN
2015-06-26
展开全部
在MSDN找到的,不知道可以用不,没测试过,呵呵
获取打印服务器承载的打印队列的集合。
命名空间: System.Printing
程序集: System.Printing(在 System.Printing.dll 中)
语法
Visual Basic(声明)
Public Function GetPrintQueues As PrintQueueCollection
Visual Basic(用法)
Dim instance As PrintServer
Dim returnValue As PrintQueueCollection
returnValue = instance.GetPrintQueues()
C#
public PrintQueueCollection GetPrintQueues()
Visual C++
public:
PrintQueueCollection^ GetPrintQueues()
J#
public PrintQueueCollection GetPrintQueues()
JScript
public function GetPrintQueues() : PrintQueueCollection
返回值
类型:System.Printing..::.PrintQueueCollection
打印服务器上的打印队列的 PrintQueueCollection。
示例
下面的示例演示如何使用此方法列出 PrintServer 承载的打印队列。
C# 复制代码
// Create a PrintServer
// "theServer" must be a print server to which the user has full print access.
PrintServer myPrintServer = new PrintServer(@"\\theServer");
// List the print server's queues
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
String printQueueNames = "My Print Queues:\n\n";
foreach (PrintQueue pq in myPrintQueues)
{
printQueueNames += "\t" + pq.Name + "\n";
}
Console.WriteLine(printQueueNames);
Console.WriteLine("\nPress Return to continue.");
Console.ReadLine();
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.5、3.0 SP1、3.0。
获取打印服务器承载的打印队列的集合。
命名空间: System.Printing
程序集: System.Printing(在 System.Printing.dll 中)
语法
Visual Basic(声明)
Public Function GetPrintQueues As PrintQueueCollection
Visual Basic(用法)
Dim instance As PrintServer
Dim returnValue As PrintQueueCollection
returnValue = instance.GetPrintQueues()
C#
public PrintQueueCollection GetPrintQueues()
Visual C++
public:
PrintQueueCollection^ GetPrintQueues()
J#
public PrintQueueCollection GetPrintQueues()
JScript
public function GetPrintQueues() : PrintQueueCollection
返回值
类型:System.Printing..::.PrintQueueCollection
打印服务器上的打印队列的 PrintQueueCollection。
示例
下面的示例演示如何使用此方法列出 PrintServer 承载的打印队列。
C# 复制代码
// Create a PrintServer
// "theServer" must be a print server to which the user has full print access.
PrintServer myPrintServer = new PrintServer(@"\\theServer");
// List the print server's queues
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
String printQueueNames = "My Print Queues:\n\n";
foreach (PrintQueue pq in myPrintQueues)
{
printQueueNames += "\t" + pq.Name + "\n";
}
Console.WriteLine(printQueueNames);
Console.WriteLine("\nPress Return to continue.");
Console.ReadLine();
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.5、3.0 SP1、3.0。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询