简体   繁体   English

使用System.Diagnostics.Process远程执行进程

[英]execute a process remotely with System.Diagnostics.Process

I'm working on an ASP.net app I'm trying to execute a process remotely , using System.Diagnostics.Process class 我正在使用System.Diagnostics.Process类在ASP.net应用程序上尝试远程执行进程

here's my code: 这是我的代码:

ProcessStartInfo startInfo = new ProcessStartInfo(@"C:\TestCommand.exe");

            startInfo.Domain = "myDomain";
            startInfo.UserName = "MyUserName";
            SecureString sec = new SecureString();

            foreach (char item in "MyPassword")
            {
                sec.AppendChar(item);                
            }
            sec.MakeReadOnly();


            startInfo.Password = sec;

            startInfo.UseShellExecute = false;
            Process.Start(startInfo);

I keep receiving an exception with the message "Logon failure: unknown user name or bad password". 我一直收到一条消息“登录失败:未知用户名或密码错误”。 Im absolutelly sure that i'm submiting my correct username/pwd 我绝对相信我正在提交正确的用户名/密码

Am I missing somethig here? 我在这里错过了什么吗?

Tks TKS

Ups,错误的域名:P

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM