[Gtk-sharp-list] spawning apps

Duncan Mak duncan@ximian.com
19 Sep 2002 10:08:23 -0400


On Thu, 2002-09-19 at 09:08, Glenn Pierce wrote:
> Currently I am doing something like this 
> 
> [DllImport("glib-2.0")] 
>          static extern bool g_spawn_command_line_sync (string command,
> string[] std_out, string[] std_err, int exit_status, IntPtr err); 
> 

Have you tried using the Process class? You can spawn a command like
this:

using System.Diagnostics;

static void Main (string [] args)
{
	string command = args [0];
	
	Process p = new Process ();
	p.StartInfo.FileName = command;
	p.Start ();

	...
}

-- 
Duncan Mak <duncan@ximian.com>