PrintJob.Username Property

Gets the name of the user that sent this job for printing

[Visual Basic]
Public ReadOnly Property Username As String
[C#]
public string Username {get;}
[C++]
public: __property string get_Username();
[JScript]
public function get Username() : string;

Property Value

Set to the login user name of the user that sent this job to be printed

Remarks

Example

[Visual Basic] The following example prints the name of the user to a trace when one of their job is deleted from the queue being monitored

[Visual Basic] 
Private mPr As PrinterMonitorComponent

Public Sub StartWatching(ByVal PrinterDeviceName As String)

   mPr = New PrinterMonitorComponent()

   AddHandler mPr.JobDeleted, AddressOf Deletedtest

   mPr.ThreadTimeout = -1
   mPr.DeviceName = PrinterDeviceName 
   
   
End Sub

Public Sub Deletedtest(ByVal sender As Object, ByVal e As EventArgs)

   With CType(e, PrintJobEventArgs).PrintJob
	Trace.WriteLine(.Username & " - had a job deleted")
   End With
End Sub

Requirements

Namespace: PrinterQueueWatch

Platforms:  Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

See Also

PrintJob overview , All PrintJob members


© 2003 Merrion Computing Ltd. All rights reserved.