日期:2014-05-17  浏览次数:21146 次

shellexecute process如何传递多个参数?
语言是C#,网页编程
运行sql security的sqlping工具
正常在命令行提示符下运行:
sqlping.exe -scantype range -StartIP 61.150.91.30 -EndIP 61.150.91.30 -Output result32.txt
没有问题,会生成f:\result32.txt,并且有检测结果。
可是用
ShellExecute(IntPtr.Zero, "open", "sqlping.exe", "-scantype range -StartIP 61.150.91.30 -EndIP 61.150.91.30 -Output result32.txt", "f:\\", 1);
会生成f:\result32.txt,但是没有检测结果,是不是参数传递的有问题(shellexecute的初始化应该没有问题)?
或者
Process process = new Process();
process.StartInfo.FileName = "f:\\sqlping.exe";
process.StartInfo.Arguments = "-scantype range -StartIP 61.150.91.30 -EndIP 61.150.91.30 -Output result32.txt";
process.Start();
这个会出现VS的调试窗口,对路径“c:\windows\system32\inetsrv\result32.txt”的访问被拒绝。
修改为"-Output f:\fesult32.txt"
提示对路径“c:\windows\system32\inetsrv\true”的访问被拒绝。

请高手指点!rtInfo.FileName = "f:\\sqlping.exe";
process.StartInfo.Arguments = "-scantype range -StartIP 61.150.91.30 -EndIP 61.150.91.30 -Output result32.txt";
process.Start();
这个会出现VS的调试窗口,对路径“c:\windows\system32\inetsrv\result32.txt”的访问被拒绝。
修改为"-Output f:\fesult32.txt"
提示对路径“c:\windows\system32\inetsrv\true”的访问被拒绝。

请高手指点!

------解决方案--------------------
http://blog.csdn.net/vbangle/article/details/6146944