473,386 Members | 1,654 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,386 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 2069
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.