Find Path To Client Application

  • Thread starter Thread starter moongirl
  • Start date Start date
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?
 
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
 
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
 
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!
 
Back
Top