473,325 Members | 2,671 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,325 software developers and data experts.

Process.Start problem

Hi,

It should be something very simple, but I do not know what I do wrong.

I display some PDF filenames form a folder into a gridview and when the user
clicks on the name, it execute this code.

System.Diagnostics.Process.Start(filename)

‘filename’ is the full path of the file (like ‘C:\Folder\file.pdf’)

When I run this from VS ( on http://localhost: …) it runs ok and open the
file in a new windows.

When I pulish the site and run it from the server the PDF doesn’t open, and
no error message appear (not even a javascript error).

I do not know why... please help. ;)

Jan 10 '06 #1
6 2065
Most likely you are having a security problem. Make sure the account your
applications runs under has enough rights to start applications.

Eliyahu

"Cosmin Spirescu" <Co************@discussions.microsoft.com> wrote in
message news:49**********************************@microsof t.com...
Hi,

It should be something very simple, but I do not know what I do wrong.

I display some PDF filenames form a folder into a gridview and when the
user
clicks on the name, it execute this code.

System.Diagnostics.Process.Start(filename)

‘filename’ is the full path of the file (like ‘C:\Folder\file.pdf’)

When I run this from VS ( on http://localhost: …) it runs ok and open the
file in a new windows.

When I pulish the site and run it from the server the PDF doesn’t open,
and
no error message appear (not even a javascript error).

I do not know why... please help. ;)

Jan 10 '06 #2
Witch one is the account my application runs under?
I have made ‘IUSR_SERVER’ (witch I believe is the account) the member of
Administrators Group, but it still doesn’t work.

Is it right what I have done?
"Eliyahu Goldin" wrote:
Most likely you are having a security problem. Make sure the account your
applications runs under has enough rights to start applications.

Eliyahu

"Cosmin Spirescu" <Co************@discussions.microsoft.com> wrote in
message news:49**********************************@microsof t.com...
Hi,

It should be something very simple, but I do not know what I do wrong.

I display some PDF filenames form a folder into a gridview and when the
user
clicks on the name, it execute this code.

System.Diagnostics.Process.Start(filename)

‘filename’ is the full path of the file (like ‘C:\Folder\file.pdf’)

When I run this from VS ( on http://localhost: …) it runs ok and open the
file in a new windows.

When I pulish the site and run it from the server the PDF doesn’t open,
and
no error message appear (not even a javascript error).

I do not know why... please help. ;)


Jan 10 '06 #3
Cosmin Spirescu wrote:
Hi,

It should be something very simple, but I do not know what I do wrong.

I display some PDF filenames form a folder into a gridview and when the user
clicks on the name, it execute this code.

System.Diagnostics.Process.Start(filename)

'filename' is the full path of the file (like 'C:\Folder\file.pdf')

When I run this from VS ( on http://localhost: ...) it runs ok and open the
file in a new windows.

When I pulish the site and run it from the server the PDF doesn't open, and
no error message appear (not even a javascript error).

I do not know why... please help. ;)


Hi Cosmin,

What are you actually trying to achieve? Process.Start is trying to run
the file on the server, not on the machine with the browser window. Is
this really what you're trying to achieve? Usually the best options
when wanting to run things on the server in response to website stuff
are 1) Having a service that can run programs independantly, or 2)
Having a program that runs when a user logs in. In both cases, the
website communicates with this other program using remoting or other
techniques (2 is preferred if interaction with the desktop e.g. a
window) may be required)

If, on the other hand (as I suspect), you're wanting the PDF to open at
the browser end, you're better of either directly linking to the pdf
file, or if (for security checking reasons, or if the files reside
somewhere that you cannot map a virtual directory to, etc), then you'll
probably want to change the Response.ContentType property to the
appropriate type for PDF and then stream the PDF down to the browser
using the Response.OutputStream

Damien

Jan 10 '06 #4
Hi Damien,

Yes, I want to open a PDF file witch is located on the server, to the
browser end, but can you be a little more explicit or can you give me an
example please.

Thank you.
If, on the other hand (as I suspect), you're wanting the PDF to open at
the browser end, you're better of either directly linking to the pdf
file, or if (for security checking reasons, or if the files reside
somewhere that you cannot map a virtual directory to, etc), then you'll
probably want to change the Response.ContentType property to the
appropriate type for PDF and then stream the PDF down to the browser
using the Response.OutputStream


Jan 10 '06 #5
Cosmin Spirescu wrote:
Hi Damien,

Yes, I want to open a PDF file witch is located on the server, to the
browser end, but can you be a little more explicit or can you give me an
example please.

Thank you.
If, on the other hand (as I suspect), you're wanting the PDF to open at
the browser end, you're better of either directly linking to the pdf
file, or if (for security checking reasons, or if the files reside
somewhere that you cannot map a virtual directory to, etc), then you'll
probably want to change the Response.ContentType property to the
appropriate type for PDF and then stream the PDF down to the browser
using the Response.OutputStream


Hi Cosmin,

The original problem code in this post:
http://groups.google.com/group/micro...8a530b7ec2b6f2

may give you an idea of how to do the sending part (although in that
case the content is already loaded, and uses WriteFile() rathen than
OutputStream), it may give you enough to work from?

Damien

Jan 10 '06 #6
Yes, this is and WORKS ;)

Thank you very much.

Jan 10 '06 #7

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

Similar topics

12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
7
by: Samantha | last post by:
Hello , I am developping a program for Win98 plateform, and I am stucking with a problem, hope you can help me. I have a program running 2 process : - One process running the Xcopy.exe -...
6
by: gizmo | last post by:
I have a requirement to initiate more than one instance of an application using the filenames. (the example below will start two instances of MS Word). My problem is that I need to kill each...
12
by: Raymond Lewallen | last post by:
How to wait for a process to stop completion is my goal. Obviously, the looping while waiting for the HasExited property is not a solution.. but thats the best I can come up off the top of my...
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...
1
by: Frank | last post by:
Hi, I use the standard example to start a program: Private Sub StartWithArguments() ' Declare and instantiate a new process component. Dim myproc As System.Diagnostics.Process myproc = New...
0
by: Sergistm | last post by:
Hello World, :D I have a problem that it is making me crazy, I hope you can help me. I'm trying to execute a .exe file with the Procces.Start, and there is no problem when the file is on my...
4
by: Paul | last post by:
Hi, I am trying to start a process hidden. My code: wordprocess = new System.Diagnostics.Process(); ; wordprocess.StartInfo = new System.Diagnostics.ProcessStartInfo(wcmd, args);...
7
by: =?Utf-8?B?ams=?= | last post by:
I am using System.Diagnostics.Process class to open a word document by call ing Process.Start("test.doc"). I am using C# as programming language. On some of the computers on running this code i get...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.