M
mxdevit
Task: run application from ASP.NET
for example,
you have a button on ASP.NET page, when press this button - one
application is invoked.
the code to run application (for example, notepad) is (on C#)
System.Diagnostics.Process.Start("notepad");
but the problem is that the application doesn't run, i.e. no window is
opened.
Note that ASP.NET code is executed on the SERVER.
Solution:
ASPNET user under which application is run should have appropriate
security settings.
1. change local policies for APSNET user:
in WinXP: run secpol.msc
go to Local Policies->User Rights Assignment
find "Deny log on locally" and remove ASPNET user from it.
then find "Deny logon locally" and remove ASPNET user from it.
2. Security for files.
if your application needs also to work with files (open, save, etc)
you have to change security settings for the folders to allow user
ASPNET modify nedeed files.
To test how it works without starting ASP.NET site you can try run in
Windows command line:
runas /user:ASPNET "notepad.exe"
it asks you for the password of ASPNET user. enter the password.
if everything is done correct you will see opened application (notepad
in our example) in new window.
More read here:
http://mxdev.blogspot.com/2008/09/asp-net-run-application-exe-from-aspnet.html
for example,
you have a button on ASP.NET page, when press this button - one
application is invoked.
the code to run application (for example, notepad) is (on C#)
System.Diagnostics.Process.Start("notepad");
but the problem is that the application doesn't run, i.e. no window is
opened.
Note that ASP.NET code is executed on the SERVER.
Solution:
ASPNET user under which application is run should have appropriate
security settings.
1. change local policies for APSNET user:
in WinXP: run secpol.msc
go to Local Policies->User Rights Assignment
find "Deny log on locally" and remove ASPNET user from it.
then find "Deny logon locally" and remove ASPNET user from it.
2. Security for files.
if your application needs also to work with files (open, save, etc)
you have to change security settings for the folders to allow user
ASPNET modify nedeed files.
To test how it works without starting ASP.NET site you can try run in
Windows command line:
runas /user:ASPNET "notepad.exe"
it asks you for the password of ASPNET user. enter the password.
if everything is done correct you will see opened application (notepad
in our example) in new window.
More read here:
http://mxdev.blogspot.com/2008/09/asp-net-run-application-exe-from-aspnet.html