public static Exception Impersonate(string aUserName, string aDomainName) { GetCheck gc = new GetCheck(); gc.Prompt = "Enter password for " + aUserName + ":"; if (gc.ShowDialog() == DialogResult.Cancel) return new Exception("User canceled"); return Impersonate(aUserName, aDomainName, gc.Result); }
public static System.Security.SecureString Fetch(string aPrompt) { System.Security.SecureString Result = new System.Security.SecureString(); using (GetCheck gc = new GetCheck(aPrompt)) if (gc.ShowDialog() == DialogResult.OK) Result = gc.Result; return Result; }