2
Answers

check the error not going inside foreach loop


 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());
Answers (2)