K kelvin357 New member Joined Feb 28, 2007 Messages 2 Programming Experience Beginner Feb 28, 2007 #1 How to get the print queue Document's count in Do.Net 1.1?
JohnH VB.NET Forum Moderator Staff member Joined Dec 17, 2005 Messages 15,874 Location Norway Programming Experience 10+ Feb 28, 2007 #2 With WMI and Win32_PrintJob class this is easy: VB.NET: Dim searcher As New ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_PrintJob") Dim printJobsQueued As Integer = searcher.Get.Count This will get the number of print jobs in queue for all printers installed on machine. To use WMI you must Add Reference to .Net library System.Management.dll and you could import the namespace (Imports System.Management) Upvote 0 Downvote
With WMI and Win32_PrintJob class this is easy: VB.NET: Dim searcher As New ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_PrintJob") Dim printJobsQueued As Integer = searcher.Get.Count This will get the number of print jobs in queue for all printers installed on machine. To use WMI you must Add Reference to .Net library System.Management.dll and you could import the namespace (Imports System.Management)
K kelvin357 New member Joined Feb 28, 2007 Messages 2 Programming Experience Beginner Mar 1, 2007 #3 Thanks for ur help I had try it ,but i cannot get the print_jobs count,can u help me again? Upvote 0 Downvote