473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 5247
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: BlackHawke | last post by:
My name is Nick Soutter, I own a small game development company (www.aepoxgames.net) making our first game (www.andromedaonline.net) in java. I am writing because we are having a very...
0
by: Kelly | last post by:
hi all, i'm using ASP.NET Web Application writie in VB, using a "File Field"component under HTML tab and i do a right click on the component and select "Run As Server Control". This was done because...
3
by: HorseGeek | last post by:
I can't find a cookie that my code is writing. The behavior of my webpages indicates that the cookie IS being written SOMEPLACE. However, I can't find it. My client does not want the code going...
1
by: Steve | last post by:
Hi all, I am referring to this article in MSDN : http://msdn.microsoft.com/library/en-us/secauthn/security/logonuser.asp While creating folder on the remote machine, we are specifying the UNC...
1
by: Kelly | last post by:
hi all, i'm using ASP.NET Web Application writie in VB, using a "File Field"component under HTML tab and i do a right click on the component and select "Run As Server Control". This was done because...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
3
by: Alan Cohen | last post by:
This seems like a really, really dumb question, but I can't seem to find the simple answer that it seems to deserve. My C#/ASP.net 2.0 app needs to email a URL link back to the site from a web...
3
by: Soulless | last post by:
Hi, I have created a batch file in C# and want to find and place it in the path of an installed application. Now, this might be done on an XP, 2000, etc system. The application is installed...
0
by: nimjerry | last post by:
i am using db2 udb V 9 on aix 5.3 and in db2diag.log alwas has this error occurr below is sample message 2008-03-03-09.45.34.366406+420 I306667A443 LEVEL: Warning PID : 835622 ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.