Connecting Tech Pros Worldwide Help | Site Map

Find Path To Client Application

moongirl
Guest
 
Posts: n/a
#1: May 18 '07
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?

Kevin Spencer
Guest
 
Posts: n/a
#2: May 18 '07

re: Find Path To Client Application


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

"moongirl" <moongirl129@hotmail.comwrote in message
news:1179487296.952710.166870@w5g2000hsg.googlegro ups.com...
Quote:
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?
>

Jiri Sitina
Guest
 
Posts: n/a
#3: May 18 '07

re: Find Path To Client Application


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

On May 18, 1:21 pm, moongirl <moongirl...@hotmail.comwrote:
Quote:
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?

moongirl
Guest
 
Posts: n/a
#4: May 18 '07

re: Find Path To Client Application


On 18 May, 12:42, Jiri Sitina <jirka.sit...@gmail.comwrote:
Quote:
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
>
On May 18, 1:21 pm, moongirl <moongirl...@hotmail.comwrote:
>
>
>
Quote:
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:
>
Quote:
System.Diagnostics.Process.Start(@"C:\Program Files
\Adobe\Reader 8.0\Reader\AcroRd32.exe", @PDFfilePath);
>
Quote:
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?- Hide quoted text -
>
- Show quoted text -
Thanks, that works great!

Closed Thread