如何下载并直接运行exe文件。 [英] How to Download and run directly a exe file.

查看:185
本文介绍了如何下载并直接运行exe文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨亲爱的,

我已经编写了下载exe文件的代码,但要求是自动运行exe文件。



这是我的下载代码...但我不知道如何在下载后直接运行它...





< pre lang =c#> string newpath = 〜 /Debug1/ConsoleApplication1.exe;
string Filename = Path.GetFileName(filepath);
Response.ContentType = application / octet-stream;
Response.AddHeader( Content-Disposition attachment; filename = + Filename + );
Response.TransmitFile(Server.MapPath(filepath.ToString()));
Response.End();





plz引导我亲爱的,提前完成..

解决方案

您无法从服务器端代码执行此操作,因为它无法访问客户端系统。自己想一想:如果网站有权在未经用户同意的情况下在客户端网站上执行任何应用程序,谁会非常勇敢地使用Web?这将是荒谬的。对于Windows系统上的某些浏览器,有一个客户端解决方法,但是甚至不想使用它。



-SA






你知道clickonce实用程序,你可以在IIS上托管你的桌面应用程序,并访问来自客户。



通过以下 google [ ^ ]链接。





谢谢

--RA


Hi dear all,
I have written a code for download exe file but the requirement is to run the exe file automatically.

Here is my download code...but i don't know how to run it directly after download...


string newpath = "~/Debug1/ConsoleApplication1.exe";
string Filename = Path.GetFileName(filepath);
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=" + Filename + "");
Response.TransmitFile(Server.MapPath(filepath.ToString()));
Response.End();



plz guide me dear, thanx in advance..

解决方案

You cannot do it from the server-side code, as it does not have any access to the client system. Think by yourself: who would be so brave to use the Web if the sites would be given a power to execute any applications on the client site without user consent? It would be a total absurd. There is a client-side workaround for certain browsers on Windows systems, but don't even play with the idea of using it.

—SA


Hi,

do you know about clickonce utility, where you can host your desktop application on IIS, and access from the clients.

Go through the below google[^] link.


Thanks
--RA


这篇关于如何下载并直接运行exe文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆