6
Answers

How do I kill a process I use to show an image file?

Jon Jacobs

Jon Jacobs

1y
576
1

Process proc=null;//declaration at top of windows form code

proc = Process.Start(imagefilename);

if (proc != null) proc.Kill();

but proc is always null.

if I use proc = new Process(); proc.StartInfo.FileName=imagefilename; proc.Start(); proc.Kill()//after image showing. gives no process associate error. Help! I am using VS 2012 Express because I have to use and create Windows Forms and newer version don't support that well or at all.

Answers (6)