Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Process Start(
- string fileName,
- string arguments,
- string userName,
- SecureString password,
- string domain
- )
- Process p = new Process();
- p.StartInfo.FileName = textFilename.Text;
- p.StartInfo.Arguments = textArgument.Text;
- p.StartInfo.UserName = textUsername.Text;
- p.StartInfo.Domain = textDomain.Text;
- p.StartInfo.Password = securePassword.SecureText;
- p.StartInfo.LoadUserProfile = true;
- p.StartInfo.UseShellExecute = false;
- try {
- p.Start();
- } catch (Win32Exception ex) {
- MessageBox.Show("Error:rn" + ex.Message);
- }
Add Comment
Please, Sign In to add comment