Executing external executibles via API in C#

  • Thread starter Thread starter anon
  • Start date Start date
A

anon

I was wondering if anyone could give me any information on accessing
the API to run external EXE's such as to run something like the
Command:

csc /t:library somefile.cs

of course this will create a dll from the shell command prompt. Is
there a way to do this via C# and issue the command to the system to
do the required function. Any information anyone could provide would
be appreciated, thanks.
 
Take a look at System.Diagnostics.Process class. You can spawn new
processes using this.
 
hi,
this code does what you wan :

using System.Diagnostics
private void button1_Click(object sender, System.EventArgs e)

{

Process p = new Process();

p.StartInfo.Arguments = "/t:library somefiles.cs";

p.StartInfo.FileName =
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe";

p.Start();

}


--
Mit freundlichen Gruessen - Regards

Ralph Gerbig
(e-mail address removed)
www.ralphgerbig.de.vu
 
Back
Top