Created
March 19, 2022 14:07
-
-
Save emoacht/a0fb90cf8f38f9f6426f314de9e63205 to your computer and use it in GitHub Desktop.
Open URL by default browser or open folder by Explorer with Windows.System.Launcher methods
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
using System; | |
using System.Windows; | |
using Windows.System; | |
public partial class MainWindow : Window | |
{ | |
public MainWindow() | |
{ | |
InitializeComponent(); | |
} | |
private async void OpenGitHub_Click(object sender, RoutedEventArgs e) | |
{ | |
await Launcher.LaunchUriAsync(new Uri(@"https://github.com")); | |
} | |
private async void OpenRoot_Click(object sender, RoutedEventArgs e) | |
{ | |
await Launcher.LaunchFolderPathAsync("c:\\"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment