Click here to Skip to main content
15,920,896 members
Home / Discussions / C#
   

C#

 
QuestionHow we can pass a string variable to matlab Pin
hediii24-May-05 5:43
hediii24-May-05 5:43 
AnswerRe: How we can pass a string variable to matlab Pin
eggie524-May-05 12:42
eggie524-May-05 12:42 
AnswerRe: How we can pass a string variable to matlab Pin
hediii25-May-05 21:59
hediii25-May-05 21:59 
GeneralOPSEC SDK Pin
NitinR24-May-05 4:54
NitinR24-May-05 4:54 
GeneralRe: OPSEC SDK Pin
Judah Gabriel Himango25-May-05 4:18
sponsorJudah Gabriel Himango25-May-05 4:18 
Generalchange number color to 128 on a tif image Pin
kyfranBibax24-May-05 4:01
kyfranBibax24-May-05 4:01 
GeneralRe: change number color to 128 on a tif image Pin
kyfranBibax25-May-05 2:00
kyfranBibax25-May-05 2:00 
GeneralWMI Win32_PrintJob and windows service Pin
Member 198883924-May-05 3:58
Member 198883924-May-05 3:58 
Hi,


I have a windows service in C# (.NET framework 1.1) running on Windows XP
PRO SP2. This service essentiallt starts a printjob watcher. Please see the code
snippet below.


queryInterval = ((SchedulerData)obj).Interval/­1000;
//queryInterval=1;
this.printEventWatcher = new System.Management.ManagementEv­entWatcher();
this.printEventWatcher.Query = new System.Management.EventQuery("­SELECT *
FROM __InstanceCreationEvent WITHIN "+queryInterval+" WHERE TargetInstance
ISA \"Win32_PrintJob\"");
string hostName = Dns.GetHostName();
this.printEventWatcher.Scope = new
System.Management.ManagementSc­ope("\\\\"+hostName+"\\root\\C­IMV2");
printEventWatcher.EventArrived­+=new EventArrivedEventHandler(this.­Arrived);
printEventWatcher.Start();


This service fires the EventArrived event when running as my login account.
i.e When the service is run as MaxBici and I login as MaxBici and print
documents, I see the events being fired.


But, when the service is run as NT AUTHORITY\SYSTEM (Local System account),
and I login as MaxBici and print documents the EventArrived event is not
fired.


The query interval was set to 1 second in both the above cases.


Could anyone help me with this?
What does the scope in the event watcher signify?
Isn't the data in the WMI tables visible to all users in a PC?


Thanks in advance.
Max


Generalcould u tell me about Integrated Security=SSPI Pin
Trivikram Dwivedi24-May-05 3:56
Trivikram Dwivedi24-May-05 3:56 
GeneralRe: could u tell me about Integrated Security=SSPI Pin
Judah Gabriel Himango24-May-05 4:33
sponsorJudah Gabriel Himango24-May-05 4:33 
GeneralRe: could u tell me about Integrated Security=SSPI Pin
Trivikram Dwivedi25-May-05 1:05
Trivikram Dwivedi25-May-05 1:05 
Generaluninstall code Pin
Mohammad Daba'an24-May-05 3:33
Mohammad Daba'an24-May-05 3:33 
GeneralPrint Direct without Spool Pin
XamIam24-May-05 3:21
XamIam24-May-05 3:21 
GeneralRe: Print Direct without Spool Pin
Serdar YILMAZ24-May-05 3:36
Serdar YILMAZ24-May-05 3:36 
GeneralRe: Print Direct without Spool Pin
XamIam24-May-05 6:36
XamIam24-May-05 6:36 
QuestionCan i open a form into tabcontrol Pin
Trivikram Dwivedi24-May-05 2:25
Trivikram Dwivedi24-May-05 2:25 
GeneralReading Roadmap from bitmapimage Pin
Nomidada24-May-05 1:39
Nomidada24-May-05 1:39 
GeneralRebooting the PC from code Pin
exhaulted24-May-05 0:01
exhaulted24-May-05 0:01 
GeneralRe: Rebooting the PC from code Pin
Colin Angus Mackay24-May-05 0:07
Colin Angus Mackay24-May-05 0:07 
GeneralRe: Rebooting the PC from code Pin
User 665824-May-05 0:11
User 665824-May-05 0:11 
GeneralRe: Rebooting the PC from code Pin
exhaulted24-May-05 0:42
exhaulted24-May-05 0:42 
GeneralRe: Rebooting the PC from code Pin
User 665824-May-05 1:01
User 665824-May-05 1:01 
GeneralRe: Rebooting the PC from code Pin
exhaulted24-May-05 1:13
exhaulted24-May-05 1:13 
GeneralRe: Rebooting the PC from code Pin
ksanju100024-May-05 7:18
ksanju100024-May-05 7:18 
GeneralRe: Rebooting the PC from code Pin
exhaulted25-May-05 23:03
exhaulted25-May-05 23:03 

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.