Click here to Skip to main content
15,912,897 members
Home / Discussions / C#
   

C#

 
AnswerRe: Win service jumps out Pin
PIEBALDconsult1-Nov-11 13:32
mvePIEBALDconsult1-Nov-11 13:32 
QuestionTheming Custom Controls At Design-Time Pin
Matt U.1-Nov-11 8:48
Matt U.1-Nov-11 8:48 
AnswerRe: Theming Custom Controls At Design-Time Pin
BobJanova2-Nov-11 0:00
BobJanova2-Nov-11 0:00 
Questioncreate DSN for oracle programatically Pin
KKSharma31-Oct-11 22:56
KKSharma31-Oct-11 22:56 
AnswerRe: create DSN for oracle programatically Pin
PIEBALDconsult1-Nov-11 2:50
mvePIEBALDconsult1-Nov-11 2:50 
QuestionHelp with GetProcesses Pin
CCodeNewbie31-Oct-11 13:03
CCodeNewbie31-Oct-11 13:03 
AnswerRe: Help with GetProcesses Pin
Pete O'Hanlon31-Oct-11 20:46
mvePete O'Hanlon31-Oct-11 20:46 
GeneralRe: Help with GetProcesses Pin
CCodeNewbie31-Oct-11 23:29
CCodeNewbie31-Oct-11 23:29 
Hi Pete,

1 & 3
The previously posted example was a Console App running as a local admin, this question is based on the script being run as a Local System Windows service. Does that not make a difference?

I am fairly sure that Local System has access to enumerate those 2 processes (it can definately get the PID & Name, as can the Local Admin user) and, as my reply in the previous posting suggests, NTAuthority\System is the owner so should be able to manipulate the processes in question. Assuming that Local System can't get those values then what role/privilege is required to be able to get the starttime & mainmodule filename?

As I mentioned in the original question, the process [] getprocesses does return the values when the starttime & mainmodule are excluded from the request. Is there a way to get it to write the System and Idle values that are available and exclude the values it can't access?

2
The TotalProcessorTime works when run as a Console App under a local admin account so why does it error as a Windows service? Do I need to pre-format the request/return value? I am afraid I don't know (yet) how to remove the tick count from a built-in property as all I am really doing is taking this http://msdn.microsoft.com/en-us/library/system.diagnostics.process.totalprocessortime.aspx and writing it into a service.

I would like to add that while my original question and this are related, I was hoping that changing the environment of the script would solve the permissions problem. I would also like to add that the WMI example can pull (most) of that data as can the Task manager pull the CPU time.

This tells me that there is a way to do it. I just don't know, and/or can't find, it. Thus my posting.

Thank you for your response.
GeneralRe: Help with GetProcesses Pin
Pete O'Hanlon1-Nov-11 0:46
mvePete O'Hanlon1-Nov-11 0:46 
AnswerRe: Help with GetProcesses - Sort of Solved Pin
CCodeNewbie2-Nov-11 12:11
CCodeNewbie2-Nov-11 12:11 
QuestionAudio processing Pin
Guy00731-Oct-11 8:09
Guy00731-Oct-11 8:09 
AnswerRe: Audio processing Pin
phil.o31-Oct-11 8:44
professionalphil.o31-Oct-11 8:44 
QuestionUnique values in list Pin
nitin_ion31-Oct-11 0:09
nitin_ion31-Oct-11 0:09 
AnswerRe: Unique values in list Pin
Pete O'Hanlon31-Oct-11 0:57
mvePete O'Hanlon31-Oct-11 0:57 
GeneralRe: Unique values in list Pin
nitin_ion31-Oct-11 1:01
nitin_ion31-Oct-11 1:01 
GeneralRe: Unique values in list Pin
Not Active31-Oct-11 2:06
mentorNot Active31-Oct-11 2:06 
GeneralRe: Unique values in list Pin
Pete O'Hanlon31-Oct-11 7:33
mvePete O'Hanlon31-Oct-11 7:33 
AnswerRe: Unique values in list Pin
Reiss31-Oct-11 3:28
professionalReiss31-Oct-11 3:28 
QuestionWCF server don't detect lost or broken connection? Pin
teknolog12331-Oct-11 0:04
teknolog12331-Oct-11 0:04 
AnswerRe: WCF server don't detect lost or broken connection? Pin
PIEBALDconsult31-Oct-11 2:44
mvePIEBALDconsult31-Oct-11 2:44 
GeneralRe: WCF server don't detect lost or broken connection? Pin
teknolog12331-Oct-11 3:18
teknolog12331-Oct-11 3:18 
GeneralRe: WCF server don't detect lost or broken connection? Pin
jschell31-Oct-11 8:34
jschell31-Oct-11 8:34 
GeneralRe: WCF server don't detect lost or broken connection? Pin
PIEBALDconsult31-Oct-11 14:02
mvePIEBALDconsult31-Oct-11 14:02 
GeneralRe: WCF server don't detect lost or broken connection? Pin
jschell3-Nov-11 7:56
jschell3-Nov-11 7:56 
AnswerRe: WCF server don't detect lost or broken connection? Pin
BobJanova31-Oct-11 3:19
BobJanova31-Oct-11 3:19 

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.