在网页上放置一个 button或者 <a></a>,点击的时候能够打开本机上的指定的exe
比如点击网页上的
<a>开始扫雷游戏</a>
点击后,打开运行本地 的 扫雷.exe。希望高手给个 简单的实例,代码中包含必要的注释。
比如点击网页上的
<a>开始扫雷游戏</a>
点击后,打开运行本地 的 扫雷.exe。希望高手给个 简单的实例,代码中包含必要的注释。
解决方案 »
- jquery两次点击事件,取不到适时的值?
- 做过工行支付接口的进来帮帮忙..很急..
- 为什么网站发布后,查询不出数据?急死我了啊!!!!!!!
- 多行文本框里的换行怎么在GridView中的字段中读取出来?
- 小问题求各位大哥帮帮忙(急急!!!!!)
- 怎么在GridView模版列的LinkButton单击事件中改变当前行的背景色?
- 100分,今天头一次用VS2005 Team Suite,没有觉得与专业版有什么不同,请大家告诉哪不用,回者有分。
- +++++++++北京公司急聘ASP.NEt软件开发工程师+++++++++
- 弹出查询页面,选择好查询条件,如何将所选择的条件值传回给父窗口,同时父窗口根据返回的值查询并显示数据?
- datagrid的checkbox模板列问题
- 求多人同时开发解决方案
- 又来麻烦高手了。。呵呵
var Shell=new ActiveXObject("WScript.Shell");
try { var kk="xxx.exe";
var aa=Shell.Run(kk,1,true);
http://clchun.javaeye.com/blog/719333
/// 从CMD运行里面启用服务
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Button4_Click1(object sender, EventArgs e)
{
//开启服务
ProcessStartInfo a = new ProcessStartInfo(@"c:\windows\system32\cmd.exe","/c net start 服务名");
a.WindowStyle = ProcessWindowStyle.Hidden;
Process process = Process.Start(a);
}
protected void Button5_Click1(object sender, EventArgs e)
{
//关闭服务
ProcessStartInfo a = new ProcessStartInfo(@"c:\windows\system32\cmd.exe","/c net stop 服务名");
a.WindowStyle = ProcessWindowStyle.Hidden;
Process process = Process.Start(a);
}
protected void Button6_Click1(object sender, EventArgs e)
{
ProcessStartInfo a = new ProcessStartInfo(@"D:\\zhengxinle\\xiangmu\\NetView\\NetView\\Transmit.exe" ,"-install");
Console.Write("安装服务成功");
a.WindowStyle = ProcessWindowStyle.Hidden;
Process process = Process.Start(a);
}
protected void Button7_Click1(object sender, EventArgs e)
{
ProcessStartInfo a = new ProcessStartInfo(@"D:\\zhengxinle\\xiangmu\\NetView\\NetView\\Transmit.exe" ,"-remove");
Console.Write("卸载服务成功");
a.WindowStyle = ProcessWindowStyle.Hidden;
Process process = Process.Start(a);
}
例如打开qqprotected void Button6_Click1(object sender, EventArgs e)
{
ProcessStartInfo a = new ProcessStartInfo(@"D:\\QQ.exe" ,"-install");
Console.Write("成功");
a.WindowStyle = ProcessWindowStyle.Hidden;
Process process = Process.Start(a);
}
你看清楚呗,我是在cmd里面启用和安装服务 cmd里面打开一个exe不是小菜! 这是看明白了就知道了!
proc.StartInfo.FileName = @"C:\Program Files\Tencent\QQ\Bin\QQ.exe";
proc.StartInfo.Arguments = "";
proc.Start();已测命名空间 using System.Diagnostics;
web程序不可能执行客户端的exe程序
除非你能忽悠别人装你的activex