zoukankan      html  css  js  c++  java
  • WPF SDK研究 Printing (2) EnumerateSubsetOfPrintQueues

    EnumerateSubsetOfPrintQueues
        shows how to use the EnumeratedPrintQueueTypes enumeration to get a subset of available print queues
        这个Sample倒也简单,只有一个Main函数,讲的是EnumeratedPrintQueueTypes枚举,通过其两个值Local和Shared将本地和共享的打印机全都找出来。

            static void Main(string[] args)
            
    {
                
    // 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();
            }

  • 相关阅读:
    如何修改tomcat默认端口号8080的方法
    mybatis中的一对多
    mysql中left join设置条件在on与where时的用法区别分析
    登录不会走自定义的FormAuthenticationFilter及其onLoginSuccess原因
    (六)SpringIoc之延时加载
    (五)SpringIoc之Bean的作用域
    (三)SpringIoc之初了解
    (二)Spring容器
    (一)Spring之初了解
    值传递和引用传递
  • 原文地址:https://www.cnblogs.com/Jax/p/1096711.html
Copyright © 2011-2022 走看看