private void buttonRegister_Click(object sender, EventArgs e) { try { if (FileShellExtension.IsRegistered()) { FileShellExtension.UnRegister(); } else { FileShellExtension.Register(); } } catch (UnauthorizedAccessException) { MessageBox.Show("Please run Application as local Admin"); } buttonRegister.Text = FileShellExtension.IsRegistered() ? "Unregister ShellExtensions" : "Register ShellExtensions"; }
public OptionsControl() { InitializeComponent(); buttonRegister.Text = FileShellExtension.IsRegistered() ? "Unregister ShellExtensions" : "Register ShellExtensions"; }