Получить лотки для принтеров и источник бумаги по выбранному имени принтера.C#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Гость
 Получить лотки для принтеров и источник бумаги по выбранному имени принтера.

Сообщение Гость »


У меня есть ListBox, в котором отображаются все принтеры, которые я могу найти в клиенте Windows.

Код: Выделить всё

List lstPrinters = new List();

foreach (var item in PrinterSettings.InstalledPrinters)
{
MyPrinterClass d = new MyPrinterClass();
d.printerName = item.ToString();

lstPrinters.Add(d);
}
Если нужен мой класс

Код: Выделить всё

public class MyPrinterClass
{
public string imageSource { get; set; }
public Bitmap imageBmp { get; set; }
public string printerName { get; set; }
public List
 paperSources { get; set; }
}
I am trying to get the trays and if possible (by the printer) the containing paperSource. The printers have to be installed on the client (its a given condition to my solution). So the details of trays and paperSource should be known by Windows.
What I tried:
By PrinterSettings.InstalledPrinters I am able to get the printerNames but there seems to be no access to other data.
by PrinterSettings.PaperSources I am able to receive the PaperSources but I am coming from a PrintDocument. So the data isnt related to the selected installed printer from my ListBox.
What I expected:
A printer class similar to the universal windows solution given by the MS Guides.
What I could do:
I could create a universal windows solution and hand over the data but its my least favorite option to do so.


Источник: https://stackoverflow.com/questions/781 ... rintername
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C#»