472,785 Members | 1,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,785 software developers and data experts.

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 5230
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: marccruz | last post by:
Given an instance of System.Diagnostics.Process, how can I get the parent process o Given an instance of System.Diagnostics.Process, how can I get the child processes For example, I start a...
1
by: Heiko Besemann | last post by:
Dear group, I created an aspx page using System.Diagnostics.Process() to launch "tracert" from shell and redirect output to Response.Output which prints it as text/plain into my browsers window....
1
by: solex | last post by:
Hello All, Hopefully someone has run into this error. I have written a class(source below) that launches a thread to monitor the StandardOutput of a System.Diagnostics.Process, in particular I...
2
by: andreas | last post by:
hi, In windows xp in the start launch menu when i put notepad "c:\test.txt" i get notepad with test.txt in it. in vb.net when i state system.diagnostics.process.start("notepad.exe" i get...
11
by: Nurit N | last post by:
This is the third newsgroup that I'm posting my problem. I'm sorry for the multiple posts but the matter becoming urgent. I hope this is the right place for it... I have created a very...
0
by: Daniel | last post by:
System.Diagnostics.Process.Start fails on windows server 2003 the process returns process.ExitCode == 0 but executing any process with System.Diagnostics.Process.Start on windows xp works fine....
0
by: Daniel | last post by:
C# windows service freezes on System.Diagnostics.Process.Start(info) When I launch PSCP from a C# windows service and launch pscp 0.53 there are no issues. but when I use C# windows service to...
0
by: Colin Williams | last post by:
I am using the code below to map network drive and then fire up an app in a sub dir of that drive. However when using the file open dialog from that app, drive K: appears just as Network drive K:...
0
by: =?Utf-8?B?UHVjY2E=?= | last post by:
-- Hi I'm using vs2005, .net 2 for windows application. The application I started using System.Diagnostics.Process is having a "listFiles.StandardOutput" buffer size problem. I was wondering...
2
by: test3 | last post by:
Hello folks, I'm using System.Diagnostics.Process to start a thirdparty program (that works perfectly when started via command line). I'm using Process.StandardOutput to get the output of the...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.