开发者

C# 4.0: System.Diagnostics.Process

Hi I would like to know if there's an existing implementation of checking if application(Acrobat Reader) exist in your local machine before I start t开发者_运维知识库o open it.

for example I want to open a pdf file and i dont have an acrobat reader, so how will I check If I have an installed program for me to open the file?.

System.Diagnostics.Process.Start("path.pdf")


You may want to look at Windows: List and Launch applications associated with an extension and IQueryAssociations.


Programmatically, here is how you'd check if Acrobat Reader is present.

Also you may check manually, if you have acrobat reader installed; somewhere here YourInstallationDrive:\Program Files\Adobe\Reader 8.0\Reader.

And then you may open the PDF like following:

Process.Start("AcroRd32.exe", "c:\myfile.pdf");


you can check this registery key to get the installed applications HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall

See the following article


use System.IO.File.Exists("Your Path")

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜