Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: Http 502 and 503 errors Pin
George_George21-Jul-08 19:24
George_George21-Jul-08 19:24 
GeneralRe: Http 502 and 503 errors Pin
N a v a n e e t h22-Jul-08 17:00
N a v a n e e t h22-Jul-08 17:00 
GeneralRe: Http 502 and 503 errors Pin
George_George31-Jul-08 2:30
George_George31-Jul-08 2:30 
QuestionMaximum buffer size while displaying to the grid Pin
tasumisra17-Jul-08 21:36
tasumisra17-Jul-08 21:36 
QuestionExcel data to dataset Pin
Sunil Wise17-Jul-08 20:52
professionalSunil Wise17-Jul-08 20:52 
AnswerRe: Excel data to dataset Pin
Sunil Wise17-Jul-08 21:29
professionalSunil Wise17-Jul-08 21:29 
QuestionWMI “Printer job status “is not working in Windows service Pin
Rajesh_K_Sharma17-Jul-08 19:39
Rajesh_K_Sharma17-Jul-08 19:39 
AnswerRe: WMI “Printer job status “is not working in Windows service Pin
Abhijit Jana17-Jul-08 21:23
professionalAbhijit Jana17-Jul-08 21:23 
Rajesh_K_Sharma wrote:
void GetStatus()
{
ManagementObjectSearcher printJobsSeacher = new ManagementObjectSearcher(@"SELECT * FROM Win32_PrintJob");
ManagementObjectCollection printJobs = printJobsSeacher.Get();
foreach (ManagementObject item in printJobs)
{
// Print JobStatus
}
}
}


if your run this code with out services does this get the print job status?

try this
<br />
using System;<br />
using System.Management;<br />
using System.Windows.Forms;<br />
<br />
namespace WMISample<br />
{<br />
    public class MyWMIQuery<br />
    {<br />
        public static void Main()<br />
        {<br />
            try<br />
            {<br />
                ManagementObjectSearcher searcher = <br />
                    new ManagementObjectSearcher("root\\CIMV2", <br />
                    "SELECT * FROM Win32_PrintJob"); <br />
<br />
                foreach (ManagementObject queryObj in searcher.Get())<br />
                {<br />
                    Console.WriteLine("-----------------------------------");<br />
                    Console.WriteLine("Win32_PrintJob instance");<br />
                    Console.WriteLine("-----------------------------------");<br />
                    Console.WriteLine("JobStatus: {0}", queryObj["JobStatus"]);<br />
                }<br />
            }<br />
            catch (ManagementException e)<br />
            {<br />
                MessageBox.Show("An error occurred while querying for WMI data: " + e.Message);<br />
            }<br />
        }<br />
    }<br />
}<br />


cheers,
Abhijit

GeneralRe: WMI “Printer job status “is not working in Windows service Pin
Rajesh_K_Sharma17-Jul-08 21:50
Rajesh_K_Sharma17-Jul-08 21:50 
QuestionHow to get the List of Database Server Pin
wasimsharp17-Jul-08 18:34
wasimsharp17-Jul-08 18:34 
AnswerRe: How to get the List of Database Server Pin
wasimsharp17-Jul-08 20:09
wasimsharp17-Jul-08 20:09 
GeneralRe: How to get the List of Database Server Pin
Jimmanuel18-Jul-08 2:13
Jimmanuel18-Jul-08 2:13 
GeneralRe: How to get the List of Database Server Pin
wasimsharp19-Jul-08 1:47
wasimsharp19-Jul-08 1:47 
QuestionRegistry Pin
damianrda17-Jul-08 18:30
damianrda17-Jul-08 18:30 
AnswerRe: Registry Pin
Simon P Stevens17-Jul-08 22:55
Simon P Stevens17-Jul-08 22:55 
AnswerRe: Registry Pin
enginço17-Jul-08 23:38
enginço17-Jul-08 23:38 
GeneralRe: Registry Pin
Simon P Stevens18-Jul-08 1:48
Simon P Stevens18-Jul-08 1:48 
GeneralRe: Registry [modified] Pin
enginço18-Jul-08 2:42
enginço18-Jul-08 2:42 
GeneralRe: Registry Pin
Simon P Stevens18-Jul-08 7:25
Simon P Stevens18-Jul-08 7:25 
QuestionDatabinding dropdown in C# Pin
sabraham17-Jul-08 17:24
sabraham17-Jul-08 17:24 
AnswerRe: Databinding dropdown in C# Pin
nelsonpaixao18-Jul-08 14:58
nelsonpaixao18-Jul-08 14:58 
GeneralRe: Databinding dropdown in C# Pin
sabraham23-Jul-08 12:07
sabraham23-Jul-08 12:07 
QuestionSystem.Net.Socket.Connected --- eek Pin
Jason McBurney17-Jul-08 15:58
Jason McBurney17-Jul-08 15:58 
GeneralRe: System.Net.Socket.Connected --- eek Pin
nelsonpaixao18-Jul-08 15:09
nelsonpaixao18-Jul-08 15:09 
GeneralRe: System.Net.Socket.Connected --- eek Pin
Jason McBurney21-Jul-08 5:55
Jason McBurney21-Jul-08 5:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.