How to invoke external application through ASP.Net web application

S

sandy

Hi,

I am trying to invoke an external email management
program from my ASP.NET web application. For testing
purposes I created a very simple webform that has a
single button. The code behind has the following:


Sub btnGo_Click(ByVal sender as System.Object, ByVal e as
System.EventArgs) Handles btnGo.Click
Dim objInfo As New ProcessStartInfo()
objInfo.FileName = "c:\program files\gammadyne
mailer\gm.exe"
objInfo.Arguments = "/t e:\temp\cba\eecm.txt"
Dim objProc As New Process()
objProc.Start(objInfo)
End Sub


When I click on the Go button, I can see gm.exe in the
Task Manager, but nothing happens. The program doesnt
send out the email like it's supposed to. When I use the
same piece of code in a Windows Application or a Windows
Service it works just fine.


I know this has to do with the security of the ASPNET
user, but I have also tried executing the webform and the
web application under a different user that belongs to
the Administrators group, but with the same result. So I
don't know what to do, please advice.


Regards,

Sandeep
 
M

Michael Nemtsev

Hello Sandy,

Do u use impersonalization to start external app?

There is a number reasons why it doesnt work, because by default the asp.net
account has no rights to interact with desktop and with network resources.

Ideally it's not a good way to start ext app from ASP.net


---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

S> Hi,
S>
S> I am trying to invoke an external email management program from my
S> ASP.NET web application. For testing purposes I created a very simple
S> webform that has a single button. The code behind has the following:
S>
S> Sub btnGo_Click(ByVal sender as System.Object, ByVal e as
S> System.EventArgs) Handles btnGo.Click
S> Dim objInfo As New ProcessStartInfo()
S> objInfo.FileName = "c:\program files\gammadyne
S> mailer\gm.exe"
S> objInfo.Arguments = "/t e:\temp\cba\eecm.txt"
S> Dim objProc As New Process()
S> objProc.Start(objInfo)
S> End Sub
S> When I click on the Go button, I can see gm.exe in the Task Manager,
S> but nothing happens. The program doesnt send out the email like it's
S> supposed to. When I use the same piece of code in a Windows
S> Application or a Windows Service it works just fine.
S>
S> I know this has to do with the security of the ASPNET user, but I
S> have also tried executing the webform and the web application under a
S> different user that belongs to the Administrators group, but with the
S> same result. So I don't know what to do, please advice.
S>
S> Regards,
S>
S> Sandeep
S>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top