Created
September 22, 2012 09:11
-
-
Save nseba/3765623 to your computer and use it in GitHub Desktop.
Open URL in default browser from elevated app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void OpenUrlInDefaultBrowser(string url) | |
{ | |
if(UacHelper.IsUacEnabled && UacHelper.IsProcessElevated) | |
{ | |
var processStartInfo = new ProcessStartInfo("explorer.exe", url); | |
processStartInfo.UseShellExecute = true, | |
processStartInfo.Verb = "runas" | |
Process.Start(processStartInfo); | |
} | |
else | |
{ | |
Process.Start(url); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment