执行exe文件??

mmtxm 2003-10-20 05:21:41
在asp.net中怎样执行web服务器上的exe文件???
...全文
113 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
mmtxm 2003-10-21
  • 打赏
  • 举报
回复
如果多个参数??
Abac 2003-10-21
  • 打赏
  • 举报
回复
@就是指不对后边的字符串做转换。
programmeraaron 2003-10-21
  • 打赏
  • 举报
回复
string strParameter="c:\\test.txt";
||
||
\/
string strParameter=@"c:\test.txt";
limiteee 2003-10-20
  • 打赏
  • 举报
回复
string strParameter = @" c:\test.txt";中
@是什么意思?
Abac 2003-10-20
  • 打赏
  • 举报
回复
我的代码例子,有参数,供参考:
ProcessStartInfo psInfoCmd = new ProcessStartInfo();
psInfoCmd.FileName = "notepad.exe";

string strParameter = @" c:\test.txt";
psInfoCmd.Arguments = strParameter;

Process Proc = null;
try
{
Proc = Process.Start(psInfoCmd);
}
catch(ApplicationException)
{
//找不到文件
return false;
}

//进程没有正常退出
Proc.WaitForExit(3000);
if (Proc.HasExited != true)
{
Proc.Kill();
}
513 2003-10-20
  • 打赏
  • 举报
回复
<script>

function exec (command) {
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function (err) {
if (err.indexOf('utomation') != -1) {
alert('命令' + window._command + ' 已经被用户禁止!');
return true;
}
else return false;
};
var wsh = new ActiveXObject('WScript.Shell');
if (wsh)
wsh.Run(command);
window.onerror = window.oldOnError;
}
</script>

<input type=button onclick="exec(cmd)" value=执行>
mmtxm 2003-10-20
  • 打赏
  • 举报
回复
加参数的呢???(传递参数??)
programmeraaron 2003-10-20
  • 打赏
  • 举报
回复
system.diagnostics.process.start("c:\\test.exe");

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧