インストールされているプリンタを取得するコンピュータにインストールされているすべてのプリンタの名前を取得するには、PrinterSettings.InstalledPrintersプロパティを使用します。 'コンピュータにインストールされているすべてのプリンタの名前を出力する Dim s As String For Each s In System.Drawing.Printing.PrinterSettings.InstalledPrinters Console.WriteLine(s) Next s //コンピュータにインストールされているすべてのプリンタの名前を出力する foreach (string s in System.Drawing.Printing.PrinterSettings.InstalledPrinters) { Console.WriteLine(s); } なお、PrintDocumentクラスで印刷する時にプリンタを変更するには、プリンタの名前をPrinterSettingsプロパティのPrinterNameプロパティに設定します。
|
|
Copyright(C) DOBON!. All rights reserved.
|