G
Guest
How can I run an .exe using C# from within the code behind of a WebForm app?
mg said:How can I run an .exe using C# from within the code behind of a WebForm app?
Nicholas Paldino said:When you call the Start method on the Process class, it runs on the
server, so you now have an instance of notepad running on the server.
If you want this to run on the client, you will have to install an
ActiveX control, or a .NET control (with the appropriate security rights)
and then spawn the process from that. These controls will run in the client
context, and allow you to run programs on that.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
mg said:I put
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\notepad.exe");
in Page_Load but notepad did not run. What did I do wrong?
mg said:The code is run in Visual Studio .NET 2003 on my desktop, so I should see
the
notepad ... I think ... ???
Nicholas Paldino said:When you call the Start method on the Process class, it runs on the
server, so you now have an instance of notepad running on the server.
If you want this to run on the client, you will have to install an
ActiveX control, or a .NET control (with the appropriate security rights)
and then spawn the process from that. These controls will run in the
client
context, and allow you to run programs on that.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
mg said:I put
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\notepad.exe");
in Page_Load but notepad did not run. What did I do wrong?
:
How can I run an .exe using C# from within the code behind of a
WebForm
app?
Where do you want to run the .exe? On the client, or the server? You
won't be able to do it on the client. To do it on the server, use
Process.Start.
Nicholas Paldino said:mg,
If you are hosting a web project in VS.NET 2003, or it is your machine,
then yes, it will show up on your desktop, because the server is on your
machine. However, for anyone outside of your machine connecting, it will
not work.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
mg said:The code is run in Visual Studio .NET 2003 on my desktop, so I should see
the
notepad ... I think ... ???
Nicholas Paldino said:When you call the Start method on the Process class, it runs on the
server, so you now have an instance of notepad running on the server.
If you want this to run on the client, you will have to install an
ActiveX control, or a .NET control (with the appropriate security rights)
and then spawn the process from that. These controls will run in the
client
context, and allow you to run programs on that.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
I put
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\notepad.exe");
in Page_Load but notepad did not run. What did I do wrong?
:
How can I run an .exe using C# from within the code behind of a
WebForm
app?
Where do you want to run the .exe? On the client, or the server? You
won't be able to do it on the client. To do it on the server, use
Process.Start.
mg said:I'm sorry, I wasn't clear. The problem is that I don't see notepad when I run
this line of code in Visual Studio .NET on my desktop ....
Nicholas Paldino said:mg,
If you are hosting a web project in VS.NET 2003, or it is your machine,
then yes, it will show up on your desktop, because the server is on your
machine. However, for anyone outside of your machine connecting, it will
not work.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
mg said:The code is run in Visual Studio .NET 2003 on my desktop, so I should see
the
notepad ... I think ... ???
:
When you call the Start method on the Process class, it runs on the
server, so you now have an instance of notepad running on the server.
If you want this to run on the client, you will have to install an
ActiveX control, or a .NET control (with the appropriate security rights)
and then spawn the process from that. These controls will run in the
client
context, and allow you to run programs on that.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
I put
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\notepad.exe");
in Page_Load but notepad did not run. What did I do wrong?
:
How can I run an .exe using C# from within the code behind of a
WebForm
app?
Where do you want to run the .exe? On the client, or the server? You
won't be able to do it on the client. To do it on the server, use
Process.Start.
mg said:I've since formally deployed the simple one-line of code, which runs in the
Page_Load of a WebForm app, to IIS on Windows Server 2003.
The app runs without error but doesn't launch notepade. Anty thoughts?
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\notepad.exe");
mg said:I'm sorry, I wasn't clear. The problem is that I don't see notepad when I run
this line of code in Visual Studio .NET on my desktop ....
Nicholas Paldino said:mg,
If you are hosting a web project in VS.NET 2003, or it is your machine,
then yes, it will show up on your desktop, because the server is on your
machine. However, for anyone outside of your machine connecting, it will
not work.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
The code is run in Visual Studio .NET 2003 on my desktop, so I should see
the
notepad ... I think ... ???
:
When you call the Start method on the Process class, it runs on the
server, so you now have an instance of notepad running on the server.
If you want this to run on the client, you will have to install an
ActiveX control, or a .NET control (with the appropriate security rights)
and then spawn the process from that. These controls will run in the
client
context, and allow you to run programs on that.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
I put
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\notepad.exe");
in Page_Load but notepad did not run. What did I do wrong?
:
How can I run an .exe using C# from within the code behind of a
WebForm
app?
Where do you want to run the .exe? On the client, or the server? You
won't be able to do it on the client. To do it on the server, use
Process.Start.
on
the server. Just no visible notepad app ???
beyond the default so that I can make notepad visible on the server?