Connecting Tech Pros Worldwide Help | Site Map

run exe from asp.net

Selen
Guest
 
Posts: n/a
#1: Nov 18 '05
How can I run the program i.e.notepad.exe from asp.net c#?

Thanks..


George Ter-Saakov
Guest
 
Posts: n/a
#2: Nov 18 '05

re: run exe from asp.net


What for?
ASP.NET executes on server side.
Your admin will curse you every time he will have to close that notepad

George.


"Selen" <skiyanc@yahoo.com> wrote in message
news:OXPlPgK7DHA.1632@TK2MSFTNGP12.phx.gbl...[color=blue]
> How can I run the program i.e.notepad.exe from asp.net c#?
>
> Thanks..
>
>[/color]


Alvin Bruney [MVP]
Guest
 
Posts: n/a
#3: Nov 18 '05

re: run exe from asp.net


No, you can tell notepad to close itself when it is done. Here is some code.

ProcessStartInfo psi = new ProcessStartInfo("notepad.exe");
psi.WindowStyle = ProcessWindowStyle.Hidden;

Process p = new Process();
p.EnableRaisingEvents = true;
p.Exited += new EventHandler(MyExited);
p.StartInfo = psi;
p.Start();

..... do stuff ...

p.Kill(); // Try killing the process

private void MyExited(object sender, EventArgs e)
{
MessageBox.Show("Exited process");
}

This will run notepad "hidden" (for illustration purposes).. Then p.Kill();
should kill it.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"George Ter-Saakov" <nospam@hotmail.com> wrote in message
news:etw$9PL7DHA.1596@TK2MSFTNGP10.phx.gbl...[color=blue]
> What for?
> ASP.NET executes on server side.
> Your admin will curse you every time he will have to close that notepad
>
> George.
>
>
> "Selen" <skiyanc@yahoo.com> wrote in message
> news:OXPlPgK7DHA.1632@TK2MSFTNGP12.phx.gbl...[color=green]
> > How can I run the program i.e.notepad.exe from asp.net c#?
> >
> > Thanks..
> >
> >[/color]
>
>[/color]


Closed Thread