当前位置:编程学习 > C#/ASP.NET >>

送分请教:.net调用应用程序,本机可以,但服务器不行,

ProcessStartInfo MyStartInfo = new ProcessStartInfo();
MyStartInfo.FileName = "cmd.exe";
MyStartInfo.UseShellExecute = false;
MyStartInfo.RedirectStandardInput = true;
MyStartInfo.RedirectStandardOutput = true;
MyStartInfo.RedirectStandardError = true;
MyStartInfo.CreateNoWindow = true;

Process MyProcess = new Process();
MyProcess.StartInfo = MyStartInfo;
MyProcess.Start();
MyProcess.StandardInput.WriteLine("c:\\test.exe");
MyProcess.StandardInput.WriteLine("exit");
strOutput = MyProcess.StandardOutput.ReadToEnd();
MyProcess.WaitForExit();

该程序可以在本机运行,但放到了服务器就不行了,在服务器cmd.exe也可以运行的,但就是调不到c:\\test.exe,我想是权限的问题,服务器是win2003来的,在网上找了很多资料,也试过把test.exe所在的文件夹权限设置为everyone,还是不行,想用模拟身份,在web.config加了这句<identity impersonate="true"/>,也是不行

请问要如何设置,才能在服务器调c:\\test.exe呢? text.exe是一个windows应用程序

除了使用Process 方法,还有其他方法调用外部应用程序的吗? --------------------编程问答-------------------- 感觉是权限问题, 用MyStartInfo.UserName和 MyStartInfo.Password 指定用户可以不? --------------------编程问答-------------------- MyStartInfo.Password 怎样设置数值的?

MyStartInfo.Password = "XXXX"; 不行哦~~ --------------------编程问答-------------------- 使用了MyStartInfo.UserName和 MyStartInfo.Password 来指定用户

还是不行~~ :( --------------------编程问答-------------------- 是否和设置与桌面交互有关呢?

但在那里服务里设置这个权限选项呢??期望那位高手可以解决这个问题.
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,