示例#1
0
 public static void RemoveUrlProtocol(string link)
 {
     try
     {
         var service = new URISchemeService(link, string.Empty, string.Empty);
         service.Delete();
     }
     catch
     {
         // ignored
     }
 }
示例#2
0
        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());
        }
示例#3
0
        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());
        }