Thanks for that Jon,
I have written the following code, but I am having a few problems. Does the
java program need to be an executable to run or is there any way I can
simply run a "java program_name" style command?
using System;
using System.Diagnostics;
using System.ComponentModel;
namespace MyProcessSample{
public class MyProcess{
public static void Main(){
try{
MyProcess myProcess = new MyProcess();
Process.Start("java XMLParse filename.txt"); }
catch(Exception e){
Console.WriteLine(e); }
}
}
}
Cheers,
David.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
David <no*@vailable.com> wrote: I am writing a C# program and want to run a java application and pass it
a filename as a parameter. I want to be able to write a method in C# that
will run this Java app for me. Eg. I want to run the following command:
java MyApplication filename.extension
Can anyone help me?
Sure - look at the System.Diagnostics.Process and ProcessStartInfo
classes. The "about" page for ProcessStartInfo gives a good example.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too