Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
QuestionC# client with a C++ server Pin
turkel3-Mar-08 22:08
turkel3-Mar-08 22:08 
GeneralRe: C# client with a C++ server Pin
Christian Graus3-Mar-08 22:12
protectorChristian Graus3-Mar-08 22:12 
GeneralRe: C# client with a C++ server [modified] Pin
turkel4-Mar-08 5:40
turkel4-Mar-08 5:40 
GeneralCreate PDF file and directly send it on particular Email address Pin
M Riaz Bashir3-Mar-08 20:04
M Riaz Bashir3-Mar-08 20:04 
GeneralRe: Create PDF file and directly send it on particular Email address Pin
Christian Graus3-Mar-08 20:34
protectorChristian Graus3-Mar-08 20:34 
GeneralRe: Create PDF file and directly send it on particular Email address Pin
Rajesh R Subramanian3-Mar-08 20:53
professionalRajesh R Subramanian3-Mar-08 20:53 
GeneralRe: Create PDF file and directly send it on particular Email address Pin
blackjack21504-Mar-08 0:16
blackjack21504-Mar-08 0:16 
GeneralException When Accessing Process.StartTime, Exc:"Access is Denied" Pin
Cyber Friend3-Mar-08 19:53
Cyber Friend3-Mar-08 19:53 
Hi there,

I have to get processes info for a system but I m having an Exception "Access is denied" in this code,

 <br />
try<br />
{<br />
   processes = Process.GetProcesses(mcName);<br />
   int nThreadsCount = 0;<br />
   foreach (Process p in processes)<br />
   {<br />
<br />
        string[] prcDetails = new string[]{p.ProcessName,<br />
                                           p.Id.ToString(),<br />
                                 // following statement causing exception<br />
                                          p.StartTime.ToShortTimeString(),<br />
                                          p.TotalProcessorTime.Duration().Hours.ToString()+":"+p.TotalProcessorTime.Duration().Minutes.ToString()+":"+p.TotalProcessorTime.Duration().Seconds.ToString(),<br />
                                          p.Threads.Count.ToString(),<br />
                                          p.HandleCount.ToString()};<br />
<br />
                       nThreadsCount += p.Threads.Count;<br />
                   <br />
      }<br />
}<br />
catch (Exception ex)<br />
{<br />
      MessageBox.Show(ex.Message);               <br />
}


When I commented the statement
p.StartTime.ToShortTimeString(),
then next statement which is also getting-time-related property
p.TotalProcessorTime.Duration().Hours.ToString()
is also causing same exception.

Here is the Sysem Trace:

" at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)\r\n at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)\r\n at System.Diagnostics.Process.GetProcessTimes()\r\n at System.Diagnostics.Process.get_StartTime()\r\n at CustomizedTaskManager.frmmain.LoadAllProcessesOnStartup() in E:\\MyProjects\\Programing\\C#\\Task Manager\\CustomizedTaskManager\\CustomizedTaskManager\\Form1.cs:line 100"

best regards,
GeneralRe: Exception When Accessing Process.StartTime, Exc:"Access is Denied" Pin
Christian Graus3-Mar-08 20:48
protectorChristian Graus3-Mar-08 20:48 
GeneralRe: Exception When Accessing Process.StartTime, Exc:"Access is Denied" Pin
Cyber Friend3-Mar-08 21:14
Cyber Friend3-Mar-08 21:14 
GeneralRe: Exception When Accessing Process.StartTime, Exc:"Access is Denied" Pin
Giorgi Dalakishvili20-Dec-11 0:43
mentorGiorgi Dalakishvili20-Dec-11 0:43 
QuestionHow to implement remote sensing image segmentation in C# Pin
Ashokpnathan3-Mar-08 19:43
Ashokpnathan3-Mar-08 19:43 
AnswerRe: How to implement remote sensing image segmentation in C# Pin
Christian Graus3-Mar-08 19:50
protectorChristian Graus3-Mar-08 19:50 
QuestionWht's The best way to add projects in solution... Pin
Amit Sk Sharma3-Mar-08 18:26
Amit Sk Sharma3-Mar-08 18:26 
GeneralRe: Wht's The best way to add projects in solution... Pin
Christian Graus3-Mar-08 18:56
protectorChristian Graus3-Mar-08 18:56 
GeneralRe: Wht's The best way to add projects in solution... Pin
Amit Sk Sharma3-Mar-08 19:35
Amit Sk Sharma3-Mar-08 19:35 
GeneralRe: Wht's The best way to add projects in solution... Pin
Christian Graus3-Mar-08 19:51
protectorChristian Graus3-Mar-08 19:51 
GeneralRe: Wht's The best way to add projects in solution... Pin
kannan M ambadi3-Mar-08 19:44
kannan M ambadi3-Mar-08 19:44 
GeneralRe: Wht's The best way to add projects in solution... Pin
Amit Sk Sharma3-Mar-08 21:45
Amit Sk Sharma3-Mar-08 21:45 
GeneralRe: Wht's The best way to add projects in solution... Pin
N a v a n e e t h4-Mar-08 0:17
N a v a n e e t h4-Mar-08 0:17 
GeneralRe: Wht's The best way to add projects in solution... Pin
Nouman Bhatti4-Mar-08 1:07
Nouman Bhatti4-Mar-08 1:07 
QuestionHow to arrange print? Pin
D i x y3-Mar-08 17:11
D i x y3-Mar-08 17:11 
AnswerRe: How to arrange print? Pin
Christian Graus3-Mar-08 17:21
protectorChristian Graus3-Mar-08 17:21 
AnswerRe: How to arrange print? Pin
yogesh_kumar_agarwal3-Mar-08 17:22
yogesh_kumar_agarwal3-Mar-08 17:22 
Generalneed help with c# textbox Pin
VyTrx3-Mar-08 16:46
VyTrx3-Mar-08 16:46 

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.