469,613 Members | 1,286 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

Diagnostics.Process class and ASP.NET

BCM
In a simple console app the following few lines open up an Acrobat file
without a hitch:

Process p = new Process();
p.StartInfo.FileName = @"C:\test.pdf";
p.Start();

But the same code in an ASP.NET app does NOTHING. No error message, not
anything at all. In fact, if I add the following line after process.Start:

.......
p.Start();
Response.Write(p.Responding.ToString());

SOMETIMES it returns True, but more often I DO get an error, which states
that "Process has exited, so the requested information is not available."

Now I've given the ASPNET user read rights on the file, but I can't think of
anything else that might be precluding the file from opening. Any ideas?
Thanks in advance!
Nov 16 '05 #1
3 5176
Hi BCM,

You have to remember that ASP.NET runs server side. Which means that when
you do a Process.Start(), it is starting that new process on the server. The
client web browser (or whatever application) will never, ever see that
process running. A console application runs on a local client, so when you
call Process.Start(), you are starting that process locally and you can
interact with it.

If you want to launch a PDF or other file on the client machine, either
provide them a link to the file that they should open or download or
Response.Redirect() to the file.

HTH,

Kyril

"BCM" <BC*@none.com> wrote in message news:40********@news.unc.edu...
In a simple console app the following few lines open up an Acrobat file
without a hitch:

Process p = new Process();
p.StartInfo.FileName = @"C:\test.pdf";
p.Start();

But the same code in an ASP.NET app does NOTHING. No error message, not
anything at all. In fact, if I add the following line after process.Start:

......
p.Start();
Response.Write(p.Responding.ToString());

SOMETIMES it returns True, but more often I DO get an error, which states
that "Process has exited, so the requested information is not available."

Now I've given the ASPNET user read rights on the file, but I can't think
of
anything else that might be precluding the file from opening. Any ideas?
Thanks in advance!

Nov 16 '05 #2
BCM
Thanks: I should have made it explicit that I WANT the file to open on the
server, not the client. The file itself has an embedded script that changes
field contents upon opening. Right after the .pdf has been opened and thus
changed, I want to direct the browser to it.

Hi BCM,

You have to remember that ASP.NET runs server side. Which means that when
you do a Process.Start(), it is starting that new process on the server. The client web browser (or whatever application) will never, ever see that
process running. A console application runs on a local client, so when you
call Process.Start(), you are starting that process locally and you can
interact with it.

If you want to launch a PDF or other file on the client machine, either
provide them a link to the file that they should open or download or
Response.Redirect() to the file.

HTH,

Kyril

"BCM" <BC*@none.com> wrote in message news:40********@news.unc.edu...
In a simple console app the following few lines open up an Acrobat file
without a hitch:

Process p = new Process();
p.StartInfo.FileName = @"C:\test.pdf";
p.Start();

But the same code in an ASP.NET app does NOTHING. No error message, not
anything at all. In fact, if I add the following line after process.Start:
......
p.Start();
Response.Write(p.Responding.ToString());

SOMETIMES it returns True, but more often I DO get an error, which states that "Process has exited, so the requested information is not available."
Now I've given the ASPNET user read rights on the file, but I can't think of
anything else that might be precluding the file from opening. Any ideas?
Thanks in advance!


Nov 16 '05 #3
I too would like to get this to work. I don't even need to "see" the
output just to have it run an application. So far it does nothing.

Robert
On Tue, 13 Jul 2004 13:59:23 -0400, "BCM" <BC*@none.com> wrote:
Thanks: I should have made it explicit that I WANT the file to open on the
server, not the client. The file itself has an embedded script that changes
field contents upon opening. Right after the .pdf has been opened and thus
changed, I want to direct the browser to it.

Hi BCM,

You have to remember that ASP.NET runs server side. Which means that when
you do a Process.Start(), it is starting that new process on the server.

The
client web browser (or whatever application) will never, ever see that
process running. A console application runs on a local client, so when you
call Process.Start(), you are starting that process locally and you can
interact with it.

If you want to launch a PDF or other file on the client machine, either
provide them a link to the file that they should open or download or
Response.Redirect() to the file.

HTH,

Kyril

"BCM" <BC*@none.com> wrote in message news:40********@news.unc.edu...
> In a simple console app the following few lines open up an Acrobat file
> without a hitch:
>
> Process p = new Process();
> p.StartInfo.FileName = @"C:\test.pdf";
> p.Start();
>
> But the same code in an ASP.NET app does NOTHING. No error message, not
> anything at all. In fact, if I add the following line afterprocess.Start: >
> ......
> p.Start();
> Response.Write(p.Responding.ToString());
>
> SOMETIMES it returns True, but more often I DO get an error, whichstates > that "Process has exited, so the requested information is notavailable." >
> Now I've given the ASPNET user read rights on the file, but I can'tthink > of
> anything else that might be precluding the file from opening. Any ideas?
> Thanks in advance!
>
>



Bank of America defines chintzy IMHO.
Email for details.
Robert Megee
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Ty Moffett | last post: by
1 post views Thread by solex | last post: by
1 post views Thread by Michael Maes | last post: by
5 posts views Thread by Saya | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.