473,412 Members | 2,054 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,412 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 9181

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. ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.