How can i sample process? [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
i have application who use specific process during running and i want to sample the process and check if the process crash in order to find the specific file who cause the crash, how can i sample process from my computer and also check if the process id changed ?

You can get the process you want by using Process.GetProcesses Method -
http://msdn.microsoft.com/en-us/library/x8b2hzk8(v=vs.110).aspx
Then it's pretty simple since you will have Process Class that will contain all data you want including ProcessID

Related

Save Screenshot to specified directory when a button is clicked [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am looking to make a small windows utility that will let the user browse to a file directory. Is there a good C# method (Windows) to execute this?
If you are using WinForms, you want FolderBrowserDialog.
See here: https://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog(v=vs.110).aspx

Detect that an application is locked [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have an application developed in C # that sometimes is blocked, when it is blocked I have to restart it. I know if there is any way to detect if the application is frozen, close it and then restart.
Thank for all!
Since it could be a third party programm you want to restart:
You restart a process in C# like so:
Process[] procs;
procs = Process.GetProcessesByName("Name");
// Test to see if the process is not responding.
if (!procs[0].Responding)
{
procs[0].CloseMainWindow();
procs[0].WaitForExit();
procs[0].Start();
}
Otherwise please follow the hints provided in the comments.

How to get power usage programmatically in Windows [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am working on a windows application(C#) to monitor computers. Are there any way to get current power usage in windows ?
This is simply not supported under Windows. MS documents their PowerManagement API
I walked through every subheading, and nowhere can such detail be monitored. If the system is on battery and you poll the %battery remaining (which is not terrible accurate), you would know about as much as is possible through the API

Linking a Website to a Console Application in C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I just wanted some general information about some technologies that would allow me to link a website to a console application in C#.
Let's say for example that users on my website fill a textfield with some information, then I want to take this information, process it into my Console Application, and print some results.
What's the technology to do this?
Thank you very much!
You can use the class System.Diagnostics.Process (see http://msdn.microsoft.com/en-us/library/vstudio/system.diagnostics.process(v=vs.100).aspx) to start your console application.
Then, you can read/write to/from StandardOutput, StandardError and StandardInput, which are normal Streams.

What is the behavior of RegistryOptions.Volatile? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am setting up a C# Windows program and I want it to include a 30-day free trial period.
I wanted to keep expiration date info in the Windows registry.
I was using RegistryKey.CreateSubKey with the RegistryOptions.Volatile option. I read that this just updates memory, not the registry files.
I saw this as a good way to test my features - set up subkeys and values that will only be around until I reboot my machine. When I get the desired behavior from the code, switch it over to RegistryOptions.None, which would create permanent registry entries.
Any things I need to be aware of?

Categories

Resources