468,170 Members | 1,945 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,170 developers. It's quick & easy.

system.diagnostics.process in asp.net

Hi,

Does anyone know how I could make an .exe launched server
side from an aspx file run faster? When I use javascript
client side it of couse is much faster. Here's my code

This code does work but it's extremely slow. What am I
missing?

Process Updater = new Process();
Updater.StartInfo.FileName = "C:\\Program
Files\\someprogram.exe";
Updater.StartInfo.Arguments = "-somearguments";

Updater.StartInfo.UseShellExecute = true;
Updater.StartInfo.CreateNoWindow = false;
Updater.StartInfo.WindowStyle =
ProcessWindowStyle.Maximized;
Updater.Start();
Updater.WaitForExit();

//Response.Write("<script>var oShell = new ActiveXObject
(\"Shell.Application\"); var commandtoRun =
\"c:\\\\Program Files\\\\someprogram.exe\"; var
commandParms = \"-somearguments";oShell.ShellExecute
(commandtoRun, commandParms,\"\", \"open\", \"1
\");</script>");
//Response.Write("<script>window.close();</script>");
Nov 15 '05 #1
3 5013
Dave,

I am assuming that you mean the startup for your exe is slow, and not
the exe itself. What you are doing seems correct. What kind of numbers are
you seeing? Also, since this is in an ASP.NET application, what kind of
load are you seeing on the server? This could be an issue.

I am confused though. You ask how you can make an exe launched server
side from an ASPX file run faster. Then you comment on how when you run it
on the client side it is much faster. Most of the time, the client and the
server are two separate machines, so you are going to see radical changes in
the way it is executed. You can't trigger a process to execute on the
client from the server side, you can only write code that when interpreted
in the browser will execute the executable.

I think that what you are trying to do is get a process to run on the
client side. You will have to use javascript injected into your page to do
this. Also, chances are you will not be able to get it to run, given the
security settings of the machine (imagine if any web page could run any
executable on the client machine that they want. Not good).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dave" <an*******@discussions.microsoft.com> wrote in message
news:36****************************@phx.gbl...
Hi,

Does anyone know how I could make an .exe launched server
side from an aspx file run faster? When I use javascript
client side it of couse is much faster. Here's my code

This code does work but it's extremely slow. What am I
missing?

Process Updater = new Process();
Updater.StartInfo.FileName = "C:\\Program
Files\\someprogram.exe";
Updater.StartInfo.Arguments = "-somearguments";

Updater.StartInfo.UseShellExecute = true;
Updater.StartInfo.CreateNoWindow = false;
Updater.StartInfo.WindowStyle =
ProcessWindowStyle.Maximized;
Updater.Start();
Updater.WaitForExit();

//Response.Write("<script>var oShell = new ActiveXObject
(\"Shell.Application\"); var commandtoRun =
\"c:\\\\Program Files\\\\someprogram.exe\"; var
commandParms = \"-somearguments";oShell.ShellExecute
(commandtoRun, commandParms,\"\", \"open\", \"1
\");</script>");
//Response.Write("<script>window.close();</script>");

Nov 15 '05 #2
Sorry for the confusion,

Actually I am trying to get the .exe run server side. All
my tests so far have been run on the same machine.
It takes almost 10 times longer using the
system.process.diagnostics then client side javascript.
There is very little load on my machine.
Am I completely missing something?

-----Original Message-----
Dave,

I am assuming that you mean the startup for your exe is slow, and notthe exe itself. What you are doing seems correct. What kind of numbers areyou seeing? Also, since this is in an ASP.NET application, what kind ofload are you seeing on the server? This could be an issue.
I am confused though. You ask how you can make an exe launched serverside from an ASPX file run faster. Then you comment on how when you run iton the client side it is much faster. Most of the time, the client and theserver are two separate machines, so you are going to see radical changes inthe way it is executed. You can't trigger a process to execute on theclient from the server side, you can only write code that when interpretedin the browser will execute the executable.

I think that what you are trying to do is get a process to run on theclient side. You will have to use javascript injected into your page to dothis. Also, chances are you will not be able to get it to run, given thesecurity settings of the machine (imagine if any web page could run anyexecutable on the client machine that they want. Not good).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dave" <an*******@discussions.microsoft.com> wrote in messagenews:36****************************@phx.gbl...
Hi,

Does anyone know how I could make an .exe launched server side from an aspx file run faster? When I use javascript client side it of couse is much faster. Here's my code

This code does work but it's extremely slow. What am I
missing?

Process Updater = new Process();
Updater.StartInfo.FileName = "C:\\Program
Files\\someprogram.exe";
Updater.StartInfo.Arguments = "-somearguments";

Updater.StartInfo.UseShellExecute = true;
Updater.StartInfo.CreateNoWindow = false;
Updater.StartInfo.WindowStyle =
ProcessWindowStyle.Maximized;
Updater.Start();
Updater.WaitForExit();

//Response.Write("<script>var oShell = new ActiveXObject (\"Shell.Application\"); var commandtoRun =
\"c:\\\\Program Files\\\\someprogram.exe\"; var
commandParms = \"-somearguments";oShell.ShellExecute
(commandtoRun, commandParms,\"\", \"open\", \"1
\");</script>");
//Response.Write("<script>window.close();</script>");

.

Nov 15 '05 #3
It could be load on the server. Also, when JavaScript does it (which
will not work by the way, the only reason it is working now is that you are
running the browser on the server as well), there is nothing that it does in
order to create an object representation of the process. .NET on the other
hand, does, and it can be costly (some other posts have complained about the
startup time of another process).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<an*******@discussions.microsoft.com> wrote in message
news:60****************************@phx.gbl...
Sorry for the confusion,

Actually I am trying to get the .exe run server side. All
my tests so far have been run on the same machine.
It takes almost 10 times longer using the
system.process.diagnostics then client side javascript.
There is very little load on my machine.
Am I completely missing something?

-----Original Message-----
Dave,

I am assuming that you mean the startup for your exe

is slow, and not
the exe itself. What you are doing seems correct. What

kind of numbers are
you seeing? Also, since this is in an ASP.NET

application, what kind of
load are you seeing on the server? This could be an

issue.

I am confused though. You ask how you can make an

exe launched server
side from an ASPX file run faster. Then you comment on

how when you run it
on the client side it is much faster. Most of the time,

the client and the
server are two separate machines, so you are going to

see radical changes in
the way it is executed. You can't trigger a process to

execute on the
client from the server side, you can only write code

that when interpreted
in the browser will execute the executable.

I think that what you are trying to do is get a

process to run on the
client side. You will have to use javascript injected

into your page to do
this. Also, chances are you will not be able to get it

to run, given the
security settings of the machine (imagine if any web

page could run any
executable on the client machine that they want. Not

good).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dave" <an*******@discussions.microsoft.com> wrote in

message
news:36****************************@phx.gbl...
Hi,

Does anyone know how I could make an .exe launched server side from an aspx file run faster? When I use javascript client side it of couse is much faster. Here's my code

This code does work but it's extremely slow. What am I
missing?

Process Updater = new Process();
Updater.StartInfo.FileName = "C:\\Program
Files\\someprogram.exe";
Updater.StartInfo.Arguments = "-somearguments";

Updater.StartInfo.UseShellExecute = true;
Updater.StartInfo.CreateNoWindow = false;
Updater.StartInfo.WindowStyle =
ProcessWindowStyle.Maximized;
Updater.Start();
Updater.WaitForExit();

//Response.Write("<script>var oShell = new ActiveXObject (\"Shell.Application\"); var commandtoRun =
\"c:\\\\Program Files\\\\someprogram.exe\"; var
commandParms = \"-somearguments";oShell.ShellExecute
(commandtoRun, commandParms,\"\", \"open\", \"1
\");</script>");
//Response.Write("<script>window.close();</script>");

.

Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by solex | last post: by
reply views Thread by Colin Williams | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.