473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Running a process from ASP.NET

I am trying to spawn a seperate process from my asp page
so when a user clicks the link or button a desktop program
is launched. This will be on an intranet and the program
will exist on the users desktop. I can use the following
code in webmatrix to run a process on my local machine:

<%@ Page Language="VB" %>
<script runat="server">

' Insert page code here
'

Sub Button1_Click(sender As Object, e As EventArgs)
Dim startInfo As System.Diagnostics.ProcessStartInfo
startInfo = New
System.Diagnostics.ProcessStartInfo()
Dim p As System.Diagnostics.Process = New
System.Diagnostics.Process()
startInfo.FileName = "c:\8133324.txt"
startInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Normal
p.Start("c:\winnt\notepad.exe")
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="Button1" onclick="Button1_Click"
runat="server" Text="Button"></asp:Button>
&nbsp;<!-- Insert content here -->
</form>
</body>
</html>
But in .NET Studio running on IIS the process doesn't
spawn. I have tried the following code:

Dim startInfo As New ProcessStartInfo("IExplore.exe")
startInfo.WindowStyle = ProcessWindowStyle.Normal
Process.Start(startInfo)

in a button click event, but nothing happens. Any help
would be greatly appreciated.
(Please send VB code, I know C# but this shop uses VB.NET
only)
John
Jul 19 '05 #1
4 9177

John wrote:
|| I am trying to spawn a seperate process from my asp page
|| so when a user clicks the link or button a desktop program
|| is launched. This will be on an intranet and the program
|| will exist on the users desktop. I can use the following
|| code in webmatrix to run a process on my local machine:
||
|| <%@ Page Language="VB" %>
|| <script runat="server">
||
|| ' Insert page code here
|| '
||
|| Sub Button1_Click(sender As Object, e As EventArgs)
|| Dim startInfo As System.Diagnostics.ProcessStartInfo
|| startInfo = New
|| System.Diagnostics.ProcessStartInfo()
|| Dim p As System.Diagnostics.Process = New
|| System.Diagnostics.Process()
|| startInfo.FileName = "c:\8133324.txt"
|| startInfo.WindowStyle =
|| System.Diagnostics.ProcessWindowStyle.Normal
|| p.Start("c:\winnt\notepad.exe")
|| End Sub
||
|| </script>
|| <html>
|| <head>
|| </head>
|| <body>
|| <form runat="server">
|| <asp:Button id="Button1" onclick="Button1_Click"
|| runat="server" Text="Button"></asp:Button>
|| &nbsp;<!-- Insert content here -->
|| </form>
|| </body>
|| </html>
||
||
|| But in .NET Studio running on IIS the process doesn't
|| spawn. I have tried the following code:
||
|| Dim startInfo As New ProcessStartInfo("IExplore.exe")
|| startInfo.WindowStyle = ProcessWindowStyle.Normal
|| Process.Start(startInfo)
||
|| in a button click event, but nothing happens. Any help
|| would be greatly appreciated.
|| (Please send VB code, I know C# but this shop uses VB.NET
|| only)
|| John

This is not possible, IIS, ASP.NET and processes spawned by one of both run in a secured desktop/winstation not the desktop of the
currently logged-on user. So you wont see the "Notepad" window pop-up, but notepad should show up under taskmanager.

Willy.
Jul 19 '05 #2
Do you understand the ASP.NET code is executed on the SERVER?
Steve
"John" <jo****************@l-3com.com> wrote in message
news:02****************************@phx.gbl...
I am trying to spawn a seperate process from my asp page
so when a user clicks the link or button a desktop program
is launched. This will be on an intranet and the program
will exist on the users desktop. I can use the following
code in webmatrix to run a process on my local machine:

<%@ Page Language="VB" %>
<script runat="server">

' Insert page code here
'

Sub Button1_Click(sender As Object, e As EventArgs)
Dim startInfo As System.Diagnostics.ProcessStartInfo
startInfo = New
System.Diagnostics.ProcessStartInfo()
Dim p As System.Diagnostics.Process = New
System.Diagnostics.Process()
startInfo.FileName = "c:\8133324.txt"
startInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Normal
p.Start("c:\winnt\notepad.exe")
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="Button1" onclick="Button1_Click"
runat="server" Text="Button"></asp:Button>
&nbsp;<!-- Insert content here -->
</form>
</body>
</html>
But in .NET Studio running on IIS the process doesn't
spawn. I have tried the following code:

Dim startInfo As New ProcessStartInfo("IExplore.exe")
startInfo.WindowStyle = ProcessWindowStyle.Normal
Process.Start(startInfo)

in a button click event, but nothing happens. Any help
would be greatly appreciated.
(Please send VB code, I know C# but this shop uses VB.NET
only)
John

Jul 19 '05 #3
John,

This sounds like a browser security issue. I'm 99.9% sure that spawning
processes on the local machine, via a web page, is turned off as it is a
"BIG" security issue, discussed in many patches that MS has put out over the
last year or so.

Try setting your browser security to low and see if that works.

-Evan

"John" <jo****************@l-3com.com> wrote in message
news:02****************************@phx.gbl...
I am trying to spawn a seperate process from my asp page
so when a user clicks the link or button a desktop program
is launched. This will be on an intranet and the program
will exist on the users desktop. I can use the following
code in webmatrix to run a process on my local machine:

<%@ Page Language="VB" %>
<script runat="server">

' Insert page code here
'

Sub Button1_Click(sender As Object, e As EventArgs)
Dim startInfo As System.Diagnostics.ProcessStartInfo
startInfo = New
System.Diagnostics.ProcessStartInfo()
Dim p As System.Diagnostics.Process = New
System.Diagnostics.Process()
startInfo.FileName = "c:\8133324.txt"
startInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Normal
p.Start("c:\winnt\notepad.exe")
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="Button1" onclick="Button1_Click"
runat="server" Text="Button"></asp:Button>
&nbsp;<!-- Insert content here -->
</form>
</body>
</html>
But in .NET Studio running on IIS the process doesn't
spawn. I have tried the following code:

Dim startInfo As New ProcessStartInfo("IExplore.exe")
startInfo.WindowStyle = ProcessWindowStyle.Normal
Process.Start(startInfo)

in a button click event, but nothing happens. Any help
would be greatly appreciated.
(Please send VB code, I know C# but this shop uses VB.NET
only)
John

Jul 19 '05 #4
I am having a similar problem with this issue, however my process is starting. The application is not firing though. I am trying to open a pdf file (or even a txt file for that matter) located on the local machine. I have
Process.Start("notepad.exe", @C:\textfile.txt).
Like i said the Process fires, but the application does not. I looked into the browser security settings. Any help is much appreciated.

Phil
Jul 12 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael Schmitt | last post by:
Hello. What is the usual way for running functions in parallel on a multiple-processor machine. Actually I want to run a single computationally expensive function with different parameter sets....
1
by: Marc | last post by:
I want to write a C#/ASP.NET application where a user can go to a web page, start running a job, close their browser, and then come back later and see the results. The purpose for this application is...
3
by: Billg_sd | last post by:
Is there a programatic way in VB.NET to determine if a specific process is running? During an app update, I need to check if the component I'm about to replace is running. In UNIX I'd use: PS |...
6
by: Moses M | last post by:
I posted this a short while ago , but I don't think I explained the problem clearly. Task Manager lists processes running on a local system, including a "user name" associated with each process...
0
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a...
4
by: sneffe | last post by:
Hi, im writing a program to keep track of which programs is currently running. I would like to have the caption of running programs displayed in a textbox on my form. I cant seem to find an easy way...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
5
by: mabond | last post by:
Hi recently read a posting and reply about Excel processs still running after the Appliction.Quit was called. Thought I might be able to use the same...
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
4
by: commander_coder | last post by:
Hello, I write a lot of CGI scripts, in Python of course. Now I need to convert some to long-running processes. I'm having trouble finding resources about the best practices to do that. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.