C#: how to catch error code
Posted on 2006-07-03
in my C# windows application (I'm using Visual Studio .Net 2003)
I need to catch the error code (sample 5 = Read-Only) of the following statement:
System.Diagnostics.Process.Start("NET", "USE \\\\" + tmpMyComputer + " /user:" + tmpMyUserID + " " + tmpMyPassword);
This is equivalent to
Net Use \\<myComputer> /user:<myuserid> <mypassword>
If anyone knows how I can catch the error code created by this statement,
please supply an appropriate code snippet.
Thank you very much for any help.