Resume any paused print jobs in the print queue in vb .net 2005


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Resume any paused print jobs in the print queue in vb .net 2005

  1. #1
    Join Date
    Jan 2007
    Posts
    1

    Resume any paused print jobs in the print queue in vb .net 2005

    Hello everybody i was wondering if you guys could help me out
    Im trying to write a program that will resume any print jobs in the print queue but i am not getting very far i keep on running into code that will not work unless i have the user input the print job id but i dont want to do that all i need to do is just have a program look at the print queue and resume anything that is currently paused in there.

    thanx
    rob

  2. #2
    Join Date
    May 2007
    Location
    Lang son and Hanoi - Vietnam
    Posts
    3
    hi, sorry about my late. your problem would be very simple if You used Net Framework 3.0 because there is a System.printing NameSpace. now, I'll give you my sample code:
    //===============
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Printing;

    namespace job_ticket
    {
    class Program
    {
    static void Main(string[] args)
    {
    LocalPrintServer localPrintServer = new LocalPrintServer();
    PrintQueue q = LocalPrintServer.GetDefaultPrintQueue();
    Console.WriteLine("List PrintJobs in the printqueue\n");
    foreach (PrintSystemJobInfo pj in q.GetPrintJobInfoCollection())
    {
    Console.WriteLine("JOB : {0}", pj.Name.ToString());
    pj.Pause();
    Console.WriteLine("\t - Status:{0}\n", pj.JobStatus.ToString());
    }
    string end;
    end = Console.ReadLine();
    }
    }
    }
    //===============
    requirement : Net FameWork 3.0
    I tested it and it run correctly. Goodluck!
    Safety first

Similar Threads

  1. VB as a career choice?
    By steve in forum Careers
    Replies: 8
    Last Post: 08-08-2008, 09:46 AM
  2. .NET vs. Enterprise Java: Who's Got Better Security?
    By Glen Kunene in forum Talk to the Editors
    Replies: 17
    Last Post: 03-23-2002, 12:43 AM
  3. YAG's public status report - March 7, 2002
    By Seth Grossman [MSFT] in forum vb.announcements
    Replies: 1
    Last Post: 03-13-2002, 07:32 PM
  4. Replies: 0
    Last Post: 08-02-2001, 09:37 PM
  5. Replies: 84
    Last Post: 01-29-2001, 01:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center