views:

236

answers:

1

Hi there, I'm working on an ASP.net app I'm trying to execute a process remotely , using System.Diagnostics.Process class

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

A: 

Ups, wrong domain :P

DJPB