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

C#

 
QuestionCAD system design Pin
Bollyjames19-Mar-12 18:58
Bollyjames19-Mar-12 18:58 
AnswerRe: CAD system design Pin
Alan Balkany21-Mar-12 4:54
Alan Balkany21-Mar-12 4:54 
Questioni have a global mouse hook working but.. Pin
gmes2919-Mar-12 14:07
gmes2919-Mar-12 14:07 
AnswerRe: i have a global mouse hook working but.. Pin
Dave Kreskowiak19-Mar-12 16:08
mveDave Kreskowiak19-Mar-12 16:08 
GeneralRe: i have a global mouse hook working but.. Pin
gmes2920-Mar-12 0:59
gmes2920-Mar-12 0:59 
Questionsame enumeration, different results? Pin
CCodeNewbie19-Mar-12 12:15
CCodeNewbie19-Mar-12 12:15 
AnswerRe: same enumeration, different results? Pin
PIEBALDconsult19-Mar-12 12:31
mvePIEBALDconsult19-Mar-12 12:31 
GeneralRe: same enumeration, different results? Pin
CCodeNewbie19-Mar-12 12:39
CCodeNewbie19-Mar-12 12:39 
Hi PIEBALDconsult,

from my previous post;
Quote
Quote:
full(ish) code, I am inserting the data int a SQL db thus the "inprocs" stuff...
Process[] processlist = Process.GetProcesses();
foreach (Process procs in processlist)
{
if (procs.ProcessName == "System")
{
insprocs.Parameters.Add("@PStart", SqlDbType.NVarChar, 30).Value = startTime.ToString();
}
}
I am currently ToString-ing it for testing but that may/may not remain the case.

If you try to GetProcesses without separating out the "System" (and "Idle")process,even though it is a DateTime, you get the error "System.ComponentModel.Win32Exception: Unable to enumerate the process modules", probably because of the "System" process's starttime properties.

So I am running GetProcesses 3 times-
1) if ((procs.ProcessName != "Idle") && (procs.ProcessName != "System")) // get everything
2) if (procs.ProcessName == "System") // get everything except "MainModule.FileName" (unenumerable for the System process)
3) if (procs.ProcessName == "Idle") // get only ProcessID, ProcessName (I think I can get RAM in use but I am not sure yet)

Depending on how you manipulate the starttime value, you get different values.

Unquote
GeneralRe: same enumeration, different results? Pin
PIEBALDconsult19-Mar-12 12:43
mvePIEBALDconsult19-Mar-12 12:43 
GeneralRe: same enumeration, different results? Pin
CCodeNewbie19-Mar-12 12:50
CCodeNewbie19-Mar-12 12:50 
GeneralRe: same enumeration, different results? Pin
PIEBALDconsult19-Mar-12 13:20
mvePIEBALDconsult19-Mar-12 13:20 
AnswerRe: same enumeration, different results? Pin
Luc Pattyn19-Mar-12 14:56
sitebuilderLuc Pattyn19-Mar-12 14:56 
GeneralRe: same enumeration, different results? Pin
CCodeNewbie20-Mar-12 0:48
CCodeNewbie20-Mar-12 0:48 
GeneralRe: same enumeration, different results? Pin
CCodeNewbie20-Mar-12 0:48
CCodeNewbie20-Mar-12 0:48 
GeneralRe: same enumeration, different results? Pin
PIEBALDconsult20-Mar-12 3:34
mvePIEBALDconsult20-Mar-12 3:34 
GeneralRe: same enumeration, different results? Pin
CCodeNewbie20-Mar-12 8:29
CCodeNewbie20-Mar-12 8:29 
GeneralRe: same enumeration, different results? Pin
PIEBALDconsult20-Mar-12 11:03
mvePIEBALDconsult20-Mar-12 11:03 
GeneralRe: same enumeration, different results? Pin
CCodeNewbie20-Mar-12 12:08
CCodeNewbie20-Mar-12 12:08 
GeneralRe: same enumeration, different results? Pin
CCodeNewbie20-Mar-12 2:30
CCodeNewbie20-Mar-12 2:30 
GeneralRe: same enumeration, different results? Pin
Alan N20-Mar-12 3:39
Alan N20-Mar-12 3:39 
GeneralRe: same enumeration, different results? Pin
CCodeNewbie20-Mar-12 8:33
CCodeNewbie20-Mar-12 8:33 
GeneralRe: same enumeration, different results? Pin
Alan N20-Mar-12 10:47
Alan N20-Mar-12 10:47 
GeneralRe: same enumeration, different results? Pin
CCodeNewbie20-Mar-12 12:00
CCodeNewbie20-Mar-12 12:00 
AnswerWrongMagicConstantInHorribleCodeException Pin
Luc Pattyn19-Mar-12 13:03
sitebuilderLuc Pattyn19-Mar-12 13:03 
GeneralRe: WrongMagicConstantInHorribleCodeException Pin
CCodeNewbie19-Mar-12 13:05
CCodeNewbie19-Mar-12 13:05 

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.