Programming/c# & winform2020. 10. 19. 12:36

일단은 프린터 나열부터 시작

        private void button1_Click(object sender, EventArgs e)
        {
            PrintQueue printQueue = null;
            LocalPrintServer localPrintServer = new LocalPrintServer();
            PrintQueueCollection localPrinterCollection = localPrintServer.GetPrintQueues();

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

            foreach (PrintQueue printer in localPrinterCollection)
            {
                //Console.WriteLine("\tThe shared printer " + printer.Name + " is located at " + printer.Location + "\n");
                textBox1.Text += printer.Name + "@" + printer.Location + "\r\n";
            }
            //Console.WriteLine("Press enter to continue.");
            //Console.ReadLine();
            //System.Collections.IEnumerator localPrinterEnumerator = localPrinterCollection.GetEnumerator();

        }

 

[링크 : https://docs.microsoft.com/ko-kr/dotnet/desktop/wpf/advanced/how-to-enumerate-a-subset-of-print-queues?view=netframeworkdesktop-4.8]

'Programming > c# & winform' 카테고리의 다른 글

c# pdf itextsharp -> itext7  (0) 2020.10.22
c# print 하기  (0) 2020.10.19
c# dialog dual screen  (0) 2020.10.15
c# dialog 전체화면  (0) 2020.10.15
c# winform / 버튼클릭 이벤트 호출하기  (2) 2020.10.15
Posted by 구차니