Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Drawing.Printing;
- using System.Windows.Forms;
- namespace R813ImpresorasInstaladas
- {
- public partial class Principal : Form
- {
- public Principal()
- {
- InitializeComponent();
- }
- private void Principal_Load(object sender, EventArgs e)
- {
- foreach (string nombreImpresora in PrinterSettings.InstalledPrinters)
- {
- txtImpresorasInstaladas.Text += nombreImpresora.ToUpper();
- txtImpresorasInstaladas.Text += "Configuración:\n";
- PrinterSettings impresora = new PrinterSettings();
- impresora.PrinterName = nombreImpresora;
- if (impresora.IsValid)
- {
- txtImpresorasInstaladas.Text += " Resoluciones soportadas:\n";
- foreach (PrinterResolution resolucionImpresora in impresora.PrinterResolutions)
- {
- txtImpresorasInstaladas.Text += " " + resolucionImpresora + "\n";
- }
- txtImpresorasInstaladas.Text += "\n Tamaños de papel soportados:\n";
- foreach (PaperSize tamahnioPapelImpresora in impresora.PaperSizes)
- {
- if (Enum.IsDefined(tamahnioPapelImpresora.Kind.GetType(), tamahnioPapelImpresora.Kind))
- {
- txtImpresorasInstaladas.Text += " " + tamahnioPapelImpresora + "\n";
- }
- }
- txtImpresorasInstaladas.Text += "\n\n";
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement