Equivalent to ShellExecute in .NET.

I am looking for a .NET preferred way of doing the same type of thing that ShellExecute does in Win32 (opening, printing, etc. for arbitrary file types).

I have been programming Windows for over 20 years, but I'm a complete newbie to .NET, so maybe I was just looking for the wrong places. I am currently using .NET 2.0 (VS C # 2005), but can use VS 2008 if necessary.

If the only answer is to use P / Invoke, then I might be better off just writing my little utility using Win32.

+45
c # winapi shellexecute windows-shell
Nov 03 '08 at 11:46
source share
3 answers

Process.Start .

Please note that for advanced use (printing, etc.), you must use ProcessStartInfo and install Verb .

+61
Nov 03 '08 at 11:48
source share

System.Diagnostics.Process.Start.

I bet you are having trouble finding it because it is in the System.Diagnostics namespace. "Diagnostics"? Usually with 20 years of experience, you get pleasure in guessing that something will be called in a new API / language, but this one has deceived me.

+36
Nov 03 '08 at 12:13
source share

You tried to use the System.Diagnostics.Process.Start () ... function. It is more or less similar to ShellExecute. You can open exes, documents. I have not checked the seal, Mark told you, as already.

+3
Nov 03 '08 at 12:15
source share



All Articles