473,796 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Diagnost ics.Process.Sta rt(@"C:\Program Files
\Adobe\Reader 8.0\Reader\Acro Rd32.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 5265
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*********@ho tmail.comwrote in message
news:11******** **************@ w5g2000hsg.goog legroups.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.Diagnost ics.Process.Sta rt(@"C:\Program Files
\Adobe\Reader 8.0\Reader\Acro Rd32.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.Diagnost ics.Process proc = new System.Diagnost ics.Process();
proc.EnableRais ingEvents=false ;
proc.StartInfo. FileName=myPdfF ilePath;
proc.Start();

It should work well for you

Jiri Sitina

On May 18, 1:21 pm, moongirl <moongirl...@ho tmail.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.Diagnost ics.Process.Sta rt(@"C:\Program Files
\Adobe\Reader 8.0\Reader\Acro Rd32.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...@g mail.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.Diagnost ics.Process proc = new System.Diagnost ics.Process();
proc.EnableRais ingEvents=false ;
proc.StartInfo. FileName=myPdfF ilePath;
proc.Start();

It should work well for you

Jiri Sitina

On May 18, 1:21 pm, moongirl <moongirl...@ho tmail.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.Diagnost ics.Process.Sta rt(@"C:\Program Files
\Adobe\Reader 8.0\Reader\Acro Rd32.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
4456
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 serious problem, and I was hoping someone might have thoughts.
0
1086
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 i wanted the user to browse a specific file in their own directory(on their client PC only). Everything was working fine when i was programming on my local PC(MY working folder in my PC) .......The problem come when i placed the working folder to...
3
4216
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 into production unless they can actually see where the cookie is being written. They are concerned that the cookie may stay around after they leave the screen and grant authorization to other users to get to web pages that they are now allowed...
1
2235
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 path as per the example. But we get this error "could not find a part of the path". we are prefixing the path with @ symbol and also tried with the escaping the "\\".
1
1552
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 i wanted the user to browse a specific file in their own directory(on their client PC only). Everything was working fine when i was programming on my local PC(MY working folder in my PC) .......The problem come when i placed the working folder to...
11
26643
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 and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my server shows the c: \php5\pear path. I can't change it no matter what I do I also tried the...
3
4418
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 page. Sending the email is no problem, but generating this URL is giving me an annoying issue in testing because of the difference in URLs between the VS web server and IIS. Specifically, the URL that I need to send when testing locally (VS...
3
3252
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 and will likely be in the registry. Does anyone know of anything in C# to check the registry for a particular application path? Say, for instance, i needed to find the Word path and place a file in it... how to check the registry through code...
0
5089
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 TID : 1 PROC : db2stmm (WEBEDIDB) INSTANCE: db2inst1 NODE : 000 DB : WEBEDIDB APPHDL : 0-8 APPID: *LOCAL.db2inst1.080229022428 AUTHID : DB2INST1 FUNCTION: DB2 UDB, Self tuning memory...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10019
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9057
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.