The problem of using Process Class...Help

  • Thread starter Thread starter Stanley
  • Start date Start date
S

Stanley

Process p = new Process();
p.StartInfo.FileName = "a.exe";
//...........

when it executes, it may be create segment error, and the
error will be displyed on the screen.

how can I make it just exit , rather than disply

and, how can i get the exitCode...

by the way, i write the code in Asp.net.....

thank you
 
Hello Stanley,

You could just wrap the Process.Start() in a try...catch block and ingore
the error. As for the exit code, there is an ExitCode property associated
with the Process class. So, you could call p.ExitCode and get the exit
code.

HTH,

Bill P.
 
Dear Bill:
the error message is disply by Windows2000, can I config
the system, so it does not disply the error....
 
I don't know. Could be a setting, but *I* personally don't know of one that
allows suppression of OS messages. You might want to talk to the developer
and see if there is a switch that allows you to disable error messages.

HTH<

Bill P
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top