System.Diagnostics.Process proc = new System.Diagnostics.Process(); System.Security.SecureString ssPwd = new System.Security.SecureString(); proc.StartInfo.UseShellExecute = false; proc.StartInfo.Verb = "runas"; proc.StartInfo.FileName = Path.Combine(Path.GetDirectoryName(@"C:\Users\ABC\Downloads\"), "ccsetup567.exe"); ; proc.StartInfo.UserName = "Admin"; string password = "admin"; for (int x = 0; x < password.Length; x++) { ssPwd.AppendChar(password[x]); } password = ""; proc.StartInfo.Password = ssPwd; proc.Start();
Quote: Note This class contains a link demand and an inheritance demand at the class level that applies to all members. A SecurityException is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see Link Demands.
UseShellExecute = true
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)