Implementing the outside application „openedFileView“ in c# Project
- by case23
I work on a application where i want to find out which files on my filesystem is used by a Process.
After trying around with the System.Diagnostics.Process class, and didn´t get the resulst i wanted i find the application called OpenedFileView from Nirsoft.
http://www.nirsoft.net/utils/opened_files_view.html
Basically it does exactly what i want but i have some problems with the implimication in my project.
The option wich “OpenedFileView” gives you is to start it with some arguments that it creates you an txt file with all the information i want.
But for my case i want to whach the processes in realtime, and if i start the application repetitively i always have the hourglass at my mouse cursor.
So after this i tryed some ways to get rid of it, tryed out to put it in a BackgroundWorker Thread. But this changed nothing at all. I also looked for a way to force the Process not to exit, and sending new arguments to it, but this also didn´t worked.
So is there any way to use this application in the way I want, or does this didn´t work at all?
I hope somebody can help me either with getting away this annoying mouse cursor hourglass, or with a better implimication of this application so i can use it in realtime!
Thanks alot!
private void start()
{
_openedFileView = new Process();
_openedFileView.StartInfo.FileName = "pathToApp\\OpenedFilesView.exe";
_openedFileView.EnableRaisingEvents = true;
_openedFileView.Exited += new EventHandler(myProcess_Exited);
_openedFileView.StartInfo.Arguments = "/scomma pathToOutputFile";
_openedFileView.Start();
}
private void myProcess_Exited(object sender, System.EventArgs e)
{
start();
}