Here i have put the code whats the problem in that code it is not going inside foreach loop
int tempValue = 0;
string f_SearchQuery = "Select * from Win32_NTLogEvent Where Logfile = 'Application' and EventCode = '10'";
ManagementObjectSearcher f_SearchPrintJobs = new
ManagementObjectSearcher(f_SearchQuery);
ManagementObjectCollection f_PrntJobCollection = f_SearchPrintJobs.Get();
foreach (ManagementObject f_PrntJob in f_PrntJobCollection)
{
String m_JobID = f_PrntJob.Properties["Logfile"].Value.ToString();
MessageBox.Show(m_JobID);
// //WriteToFile(m_TotalPages, m_JobID);
// }
// Timer1.Start();
}
MessageBox.Show(tempValue.ToString());
Loading
Roei BarPosted Sep 22, 2009, 11:39 AM
MessageBox.Show(f_PrntJobCollection.Count.ToString());
add this before the foreach
i belive that you will see that you have 0 in the collection :-)
Rajeswari nathanPosted Sep 22, 2009, 9:50 AM