Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Process proc = new Process();
- try
- {
- string uName = Properties.Settings.Default.uName;
- SecureString pWord1 = String2SecureString(Properties.Settings.Default.pWord);
- string doMain = Properties.Settings.Default.doMain;
- proc.StartInfo.UseShellExecute = false;
- proc.StartInfo.LoadUserProfile = true;
- string path = Environment.CurrentDirectory;
- proc.StartInfo.WorkingDirectory = path;
- proc.StartInfo.FileName = apptoopen;
- proc.StartInfo.Domain = doMain;
- proc.StartInfo.UserName = uName;
- proc.StartInfo.Password = pWord1;
- proc.Start();
- }
- catch (InvalidOperationException e)
- {
- MessageBox.Show(e.Message);
- }
- catch (Win32Exception e)
- {
- MessageBox.Show(e.Message);
- }
- catch (Exception e)
- {
- MessageBox.Show(e.Message);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement