Detect that an application is locked [closed] - c#

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.

Related

How do I make my code run when it is not selected? [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 5 years ago.
Improve this question
I'm writing a c# console application and I want it to monitor all keyboard input, even when other programs have focus, so that if a person hits a specific key combination (from anywhere), my code will be activated.
Currently when I run my program and then select another program, my program does not do anything when I enter the key combination.
A thread might be a good idea.
Sorry for my grammar and English. I try to explain it good.
Console application is not suitable for that. you should be looking for Keyboard Hook.
Have a look at this question.

How to set system volume on ENTER keypress in c# console application? [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 would like to make a console application in which if a certain user types "volume up" and presses the ENTER key then the system volume to go up.
Any ideas?
For creating a console application in c#:
How to: Create a C# Console Application
To read the input text from a console application: Console.ReadLine Method
To set the system volume programmatically: Paedow's question and answer
Having these links your job is quite easy now. :)

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.

Can you add a Console program to a WindowsFormApplication program? [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 8 years ago.
Improve this question
I want to make a C# WindowsFormApplication project to collect and store answers.
I then want to use these answers to generate input for selenium web driver which is a console application.
Is it possible to join the two projects together so I first collect my answers on the form, and when I click run on the windows application form, for the console application to start running? If so, how would this be done?
In case you don't want to use database as suggested by kat0r you can use sockets to make them communicate together.
The obvious answer would be to store the questions in a file/database, and simply access it from both applications. You can start other programs with something like Process

How can i sample process? [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 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

Categories

Resources