Run exe from Sharepoint web part

喜夏-厌秋 提交于 2019-12-02 04:18:06

Quite frankly this is not possible. The code you have written is executed on the SharePoint server in the security context of the web app user. So if anything happens at all, a calculator is opened for the web app user and certainly not for your user.

If you want to do something like this you have to revert to client side scripting technologies, e.g. Silverlight or JavaScript. However, you have to deal with permission issues then as scripts normally can't access the local hard disk to improve security.

This is highly unadvisable to run executables from a web page, as this requires you to lower the browser security settings to such a level that could endanger the client PC, as pretty much any software can be downloaded and executed, without the user even knowing that. As pointed out in the earlier answer, the code you wrote will run the calculator on the server, not the client. It works on your dev machine because it is both server AND client, this will not work in the real world. The only way to do it is using some client side code, such as Javascript or Silverlight, but I would not recommend that. The best alternative would be adding a browser-hosted calculator directly to your web part, such as one using jQuery: the first search result: http://keith-wood.name/calculator.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!