how to get admin prompt programmatically c# code example
Example 1: easily start admin process from service c#
public void ExecuteAsAdmin(string fileName)
{
Process proc = new Process();
proc.StartInfo.FileName = fileName;
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.Verb = "runas";
proc.Start();
}
Example 2: c# request run as administrator
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />