Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button2_Click(object sender, EventArgs e)
- {
- textBox3.Text = path;
- textBox2.Text = password;
- textBox3.Text = username;
- var secure = new SecureString();
- foreach (char c in textBox2.Text)
- {
- secure.AppendChar(c);
- }
- System.Diagnostics.Process process = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
- startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
- startInfo.UserName = username;
- startInfo.Password = secure;
- startInfo.FileName = "cmd.exe";
- startInfo.Arguments = String.Format("/C cmd /K \"{0}\"", path);
- process.StartInfo = startInfo;
- //startInfo.UseShellExecute = false;
- process.Start();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement