运行exe文件的代码 [英] code for running exe file

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

问题描述

如何在点击链接按钮时给出.exe的相对路径,以便它可以在任何计算机上运行而无需更改代码中的路径??

解决方案

< blockquote>你可以给出一个相对路径:

 Process.Start( @  .. \ MyApp.exe); 







但是......一个想法。

如果您希望在客户端PC上执行该应用程序,这将无效 - 您无法从服务器或从服务器执行此操作浏览器。

[/ edit]


how to give the relative path of .exe when clicked on link button so that it could be run on any computer without changing the path in the code??

解决方案

You can just give a relative path:

Process.Start(@"..\MyApp.exe");



[edit]
But...a thought.
This won't work if you are expecting the application to be executed on the client PC - you can't do that from the server or from a browser.
[/edit]


这篇关于运行exe文件的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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