mario.deghetto

Visual Basic & .NET
posts - 332, comments - 79, trackbacks - 0

#56 – [VB.NET] Verificare lo stato della coda di stampa predefinita

Se avete la necessità di verificare lo stato della coda di stampa predefinita, potete utilizzare il namespace System.Printing che trovate però solo dal Framework .NET 3.0 in poi.

Per prima cosa dovete aggiungere un riferimento a System.Printing nella scheda Riferimenti delle proprietà del progetto.

Una volta aggiunto il riferimento, utilizzate un codice simile a questo:

Imports System.Printing
Public Class Form1

   Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click Dim ps As New LocalPrintServer() Dim pq As PrintQueue = ps.DefaultPrintQueue Dim err As Boolean = pq.IsInError If err = True Then MessageBox.Show("Errore di stampante") Else MessageBox.Show("Nessun errore di stampante") End If End Sub End Class

Print | posted on domenica 4 ottobre 2009 15.19 |

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 6 and 3 and type the answer here:

Powered by: