[Mono-list] Opening a file and directory in the system's default viewer

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Fri Aug 20 17:37:03 EDT 2010


On Sat, 2010-08-14 at 00:27 -0700, Indrid Cold wrote:
> I'm sure this question has been asked before, however I can't seem to find it
> by searching. I think I don't know the correct terms.
> 
> What I'm trying to do is make it possible for a program written in C# to
> make the OS open a file or show a directory, using the OS's default programs
> set to open that type of file and to explore directories. Preferably this
> would be a universal way, that would work in any OS and with either Mono or
> .Net.
> 
> I've tried using System.Diagnostics.Process.Start using only the
> file/directory's full address as an argument. This used to work in Linux as
> well but now for some reason doesn't (after upgrading Mono) and instead it
> complains that the file isn't an executable.

This should work as long as you have xdg-open installed in your system.
What values are you setting in ProcessStartInfo?

-Gonzalo




More information about the Mono-list mailing list