[dba-VB] Launch and monitor external programs from .NET (was: Open PDF file)

Gustav Brock Gustav at cactus.dk
Thu Dec 6 01:18:50 CST 2007


Hi David

I have not tried your code ... so just a stupid question: Is Adobe Reader (or another pdf-application) installed on the user's machine?

/gustav

>>> newsgrps at dalyn.co.nz 06-12-2007 01:48:36 >>>
I included Gustav's code in my web application as below:

Dim runPdf As New System.Diagnostics.Process
runPdf.StartInfo.FileName = HttpContext.Current.Server.MapPath("") + 
"\PDFFiles\" + strReportFile + ".pdf"
runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal
runPdf.Start()

However, when it is run by a user I get the following error: No 
application is associated with the specified file for this 
operation.  It seems to be wanting to open the file on the server.

Do I need to install Adobe Acrobat on the server?  I would have 
thought that it would use the local machines copy.

David

At 27/11/2007, you wrote:
>Hi David et al
>
>A lot of useful things can be done with the Process class.
>Some examples here:
>
>   http://www.thescarms.com/dotnet/Process.aspx 
>
>/gustav
>
> >>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>>
>I am using VS 2005 and VB.Net for a web site.
>
>I have a number of PDF files that are stored in a static folder on the server.
>
>Users select from a list on files on a web page and I want to open
>the files in Adobe.  Adobe reader is installed on the server.
>
>Can anyone give me a pointer to how I can take a string with path and
>file name, and open it?
>
>Regards
>
>David Emerson
>Dalyn Software Ltd
>Wellington, New Zealand





More information about the dba-VB mailing list