public static void SetUrlProtocol(string link) { try { var service = new URISchemeService(link, @"URL:ShadowsocksR Link", $@"""{Utils.GetExecutablePath()}"""); service.Set(); } catch { // ignored } }
public void LocalMachineTest() { const string key = @"ssb"; var service = new URISchemeService(key, @"URL:ssa Protocol", @"D:\MyAppPath\MyApp.exe --openurl", RegisterType.LocalMachine); Assert.IsFalse(service.Check()); service.Set(); Assert.IsTrue(service.Check()); service.Delete(); Assert.IsFalse(service.Check()); }
public void CurrentUserTest() { const string key = @"ssa"; var service = new URISchemeService(key, @"URL:ssa Protocol", @"D:\MyAppPath\MyApp.exe --openurl"); Assert.IsFalse(service.Check()); service.Set(); Assert.IsTrue(service.Check()); service.Delete(); Assert.IsFalse(service.Check()); }