469,578 Members | 1,699 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Find Path To Client Application

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?

May 18 '07 #1
3 5126
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" <mo*********@hotmail.comwrote in message
news:11**********************@w5g2000hsg.googlegro ups.com...
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?

May 18 '07 #2
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:
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?

May 18 '07 #3
On 18 May, 12:42, Jiri Sitina <jirka.sit...@gmail.comwrote:
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:
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?- Hide quoted text -

- Show quoted text -
Thanks, that works great!

May 18 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by BlackHawke | last post: by
reply views Thread by Kelly | last post: by
1 post views Thread by Steve | last post: by
1 post views Thread by Kelly | last post: by
11 posts views Thread by cybervigilante | last post: by
3 posts views Thread by Alan Cohen | last post: by
3 posts views Thread by Soulless | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.