开发者

Run a program on the server through an ASP.NET page

we are using a special software that usually runs on one of our server machines and is used to solve some scientific problems and generate complex plots (jpg). The problem with this program is that its run through the command line and does not provide for a very good user experience. To address this issue, I have developed an ASP.NET page that calls the server program using System.Diagnostics.Process method and returns the computed values to users on our LAN.

When I run the ASP.NET application in debug mode (Visual Studio 2010), I am able to see the program window and everything is computed properly. However, as soon as I deploy it on IIS, the program is behaving strangely. The plots that are generated do not show some values/color codes correctly. Also, I am unable to see the program window when the ASPNET process calls the program.

Any clues why this could be happening? I am trying to run the ASP.NET application with elevated privileges but have no clue how to do it. I have checked out hundreds of posts on the internet but was unable to find anything specific. Would be glad if someone can point me in the right direction.

System Info: Windows 7 Home IIS 7 Visual Studio 2010 (VB.NET)

I am a beginner, so request you to provide any references to key terms if possible.

Thanks

Here is how I am calling the program from the ASP.NET application -

Hi Kev, this is how I am calling the application:

        Dim luaProcess As Process = New Diagnostics.Process
        luaProcess.StartInfo.FileName = strFemmExePath
        luaProcess.Star开发者_Python百科tInfo.Arguments = " -lua-script=" + strUserLuaFile

        luaProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
        luaProcess.StartInfo.UseShellExecute = False
        luaProcess.StartInfo.CreateNoWindow = False
        luaProcess.StartInfo.RedirectStandardError = True
        luaProcess.Start()

The strFemmExePath variables is defined as the exe path on the server machine i.e. C\Program Files\FEMM\bin\femm.exe. The Argument takes a script file that carries the instructions for the program.

The output is basically 2 files:

1 formatted text file that contains the computed values, which I am reading using ASP.NET and displaying back after some formatting.

The second file is a bitmap file which contains a graph. I am converting this bitmap into a jpeg using the ASP.NET application because its very large in size.


The only reason you're seeing your console application running on your development PC is because your running Visual Studio under your own account and most likely using the built-in Cassini server. This means the console app will launch under your account and will have permission to display a console window.

When running under a service account (such as those used by and IIS worker process) these accounts can't interact with the desktop of the logged in user and thus will never show a UI of any sort.

The reasons as to why your application isn't outputting the plots correctly could be many and varied and without knowing how it works it would be hard to speculate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜