我希望pdf文件在pdf阅读器中打开,而不是在asp.net应用程序中的pdf书写器中打开

问题描述:

我有一个pdf文档,默认情况下要在Adobe Reader中打开.但是在系统中,默认情况下安装了Adobe Acrobat 6.0 writer和Adobe Reader 8.0,我的代码是在asp.net应用程序中的Adobe Acrobat 6.0 writer中打开pdf文档.可以帮助通过C#代码将Adobe Reader 8.0设置为默认值

高度赞赏您的建议

I have a pdf document which i want to open in Adobe Reader by default. but in system Adobe Acrobat 6.0 writer installed & Adobe Reader 8.0 is installed by default my code is opening pdf document in Adobe Acrobat 6.0 writer in my asp.net application. can some one help to make Adobe Reader 8.0 to be default through C# code

your suggestions highly appreciated

您不能强迫客户端使用任何特定应用程序从服务器打开文件:这完全取决于客户端具有的文件关联当前设置.

如果可以在客户端上运行应用程序(再次不能从服务器上运行),则可以通过注册表设置文件关联(此处有一个示例: ^ ]),但我强烈不建议这样做.我有许多视频程序,有些会自动更改文件关联.这些是我删除的程序,以后再也不会安装.
You cannot force the client to use any particular application to open a file from the server: It all depends on the file associations that the client has currently set.

If you can run an application on the client (which you again, can''t from the server) then you could set the file associations via the registry (there is an example here: http://*.com/questions/69761/how-to-associate-a-file-extension-to-the-current-executable-in-c[^]) but I woudl strongly not recommend it. I have a number of video programs, and some automatically change the file associations. Those are the programs I delete and never install again.