Process.Start无法在Asp .net构建中运行(在inetmgr下) [英] Process.Start not working in Asp .net build(Under inetmgr)
本文介绍了Process.Start无法在Asp .net构建中运行(在inetmgr下)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友
我已使用process.start运行bat文件.这将打开命令提示符,并在Asp .net代码中正常运行.但是,如果我在inetmgr中进行构建和部署,它将无法正常工作.它甚至不调用命令提示符.
谁能帮我.
这是代码.
Hello friends
I have used process.start to run a bat file. This opens command prompt and works well in Asp .net code. But if I take build and deploy in inetmgr, it does not work. It does not even invoke command prompt.
Can anyone help me.
Here is the code.
Process objProcess = new Process();
ProcessStartInfo objStartupInfo = new ProcessStartInfo();
objStartupInfo.FileName = @"E:\Projects\Snif\SNIF3.0\SNIF3\web\SNIF\sniffiles\snifschedules\BatFiles\3523a7d9d8a-8df8-457e-8549-cdc8e103555d.bat";
objStartupInfo.CreateNoWindow = true;
objStartupInfo.UseShellExecute = false;
objProcess.StartInfo = objStartupInfo;
objProcess.Start();
objProcess.WaitForExit();
在此先感谢
Thanks in advance
推荐答案
如果您使用ProcessStartInfo的msdn页面,您将看到有一些特殊的安全说明.它不起作用的原因是,asp页无权执行其他程序集,并且也可能被拒绝访问该目录.
http://msdn.microsoft.com/en-us/library/system.diagnostics. process.aspx [^ ]
http://msdn.microsoft.com/en-us/library/ee817643.aspx#authaspdotnet_relationship [^ ]
祝你好运!
If you take the msdn page of ProcessStartInfo you'' ll see that there are special security notes. The reason that it doesn'' t work is that the asp page isn'' t authorized to execute other assemblies and could also be denied access to the directory.
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^]
http://msdn.microsoft.com/en-us/library/ee817643.aspx#authaspdotnet_relationship[^]
Good luck!
这篇关于Process.Start无法在Asp .net构建中运行(在inetmgr下)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文