Find Path To Client Application

M

moongirl

Part of an application I am building includes a button which the user
can click on to view a PDF file in Acrobat Reader, using the following
code:

System.Diagnostics.Process.Start(@"C:\Program Files
\Adobe\Reader 8.0\Reader\AcroRd32.exe", @PDFfilePath);


However the path to acrobat reader is the path on my PC - what if the
path is different on the user's PC? How can I change the code to find
the path to the executable so it will work on any machine?
 
K

Kevin Spencer

Look in the user's registry.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
J

Jiri Sitina

Wouldn't it be better if you execute created pdf file directly - using
any pdf file viewer your client may use?

the execution may be provided as follows:

System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName=myPdfFilePath;
proc.Start();

It should work well for you

Jiri Sitina
 
M

moongirl

Wouldn't it be better if you execute created pdf file directly - using
any pdf file viewer your client may use?

the execution may be provided as follows:

System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName=myPdfFilePath;
proc.Start();

It should work well for you

Jiri Sitina





- Show quoted text -

Thanks, that works great!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top