Questions tagged [system.diagnostics]

System.Diagnostics is a namespace of the .NET framework. It provides classes that allow you to interact with system processes, event logs, and performance counters.

System.Diagnostics is a namespace of the .NET framework. It provides classes that allow you to interact with system processes, event logs, and performance counters.

References

670 questions
0
votes
1 answer

How to record log info to flat file + Event Log

I have a 3rd-party app that logs (verbosely) to the users' Appdata folder. I'd like to augment that behavior to also record Errors to the EventLog. How can I accomplish this? Note that the app's source code is not available; I can only modify the…
0
votes
2 answers

Process.Start capturing standard output characters

I have a Windows Service that is going to process results from plink.exe (Putty/SSH thing). I'm currently successfully capturing the standard output and sending commands via the standard input to the process. My problem is, the OutputDataReceived…
Adam Plocher
  • 13,994
  • 6
  • 46
  • 79
0
votes
1 answer

System.diagnostics logging issue + Wix application name change

In my application i have configured the Trace listener as below "HelloWorld" is my AssemblyName and Namespace
Sanjaybxl
  • 63
  • 8
0
votes
1 answer

Find a process by windowclass name and window name but what if wname was changed

I have a function for finding a process by windowclass name and window name but sometimes the user is changing the windowname and my function does nothing. Is there any other way of finding the process?
John Mokien
  • 435
  • 4
  • 12
0
votes
2 answers

How to get the physical file name of running class library

I'm trying to create a class library which will load different files depending on its physical file name. i.e. if physical file name is called "test.dll" it will load its settings from "test.config", if the file is duplicated and renamed to…
zaza
  • 892
  • 1
  • 18
  • 37
0
votes
0 answers

System.Diagnostics.PerformanceCounter Measure CPU utilization per module

is it possible to track the cpu utilisation per module in a process? In below code can CPU and memory consumption for each module in myProcess.Modules be determined? Process[] currentProcesses = Process.GetProcesses(); Process myProcess =…
DenizEng
  • 400
  • 4
  • 14
0
votes
1 answer

Process.StandardInput.WriteLine Not working on Java.exe

I'm having an issue with the following code: private void Form1_Load(object sender, EventArgs e) { cmdOutput = new StringBuilder(""); cmdProcess = new Process(); cmdProcess.StartInfo.WorkingDirectory = @"C:\android-sdk\tools"; …
james
  • 1,031
  • 1
  • 15
  • 31
0
votes
2 answers

Queuing installations via Process.Start

I need to queue approximately 20 installations that are fully unattended (Using a C# winform application). Each installation has its own INI file (that is manually created) that contains the proper information on what arguments each installer…
devHead
  • 794
  • 1
  • 15
  • 38
0
votes
2 answers

Trace file isn't being created even though TraceEvent is called?

Objective Use System.Diagnostics to perform tracing. Though I have used log4net and other logging solutions, I am only interested in getting tracing to work with System.Diagnostics. Problem Even though I'm issuing the TraceEvent the file is not…
Mike Perrenoud
  • 66,820
  • 29
  • 157
  • 232
0
votes
1 answer

Why is this Performance Monitor Code failing

This code used to work, now it throws exception and refuses to work. The code didn't change. I suspect the cause is when I partitioned my disk to add a second partition. The intended purpose is to monitor the %idle time of the physical drive that…
Joshua
  • 40,822
  • 8
  • 72
  • 132
0
votes
1 answer

How to invoke TraceListener.Write(object) through TraceSource

We have a custom TraceListener implementation which only logs when a specific object (LogMessage) is received. This all works well when using directly with the Trace.Write(object) method. Due to Performance reason, I want to separate the Listener,…
Thomas Zweifel
  • 627
  • 1
  • 6
  • 19
0
votes
1 answer

How do I redirect the process of executable in commandline?

I have an executable called outtext.exe which writes some output to console. I want to write this output directly to file in the commandline. I know I can capture the output from the Process object but now I just want to use my command as is. I…
serializer
  • 1,003
  • 2
  • 13
  • 27
0
votes
0 answers

PerformanceCounterType.NumberOfItems32 count last minute

How to count the total increment of last minute? //Create Counter CounterCreationDataCollection counter = new CounterCreationDataCollection(); CounterCreationData total = new CounterCreationData(); total.CounterName…
user1037792
  • 91
  • 1
  • 6
0
votes
1 answer

How to add a folder (with help) to resources and how to work with it

I am working on a basic calculator and I want to have a Help in it. I've already written it in XHTML. It is about 30 html files and over 30 jpg files (everything in a folder 'help'). Now a I would like to add this all into my Form. I don't know to…
0
votes
1 answer

Debugger.Launch()

So we're in a windows server 2008 environment where multiple developers are terminaled in, working on different parts of the same code. (I know, it's ugly, no revision control.) The question is, and would kinda be regardless, If someone uses…
PrinPlup
  • 9
  • 2