June 28, 2010 by Christoff Truter C# Integration
In the following example we're going to create a simple url protocol (like mailto/http etc) handler, e.g.
<a href="test:123">Some Text</a>
RegistryKey Key = Registry.ClassesRoot.CreateSubKey("test");
Key.CreateSubKey("DefaultIcon").SetValue("", "test.exe,1");
Key.SetValue("", "test:Protocol");
Key.SetValue("URL Protocol", "");
Key.CreateSubKey(@"shell\open\command").SetValue("", "test.exe %1");
using System;
using System.Collections.Generic;
using System.Text;
class Program
{
static void Main(string[] args)
{
foreach (string s in args)
{
Console.WriteLine(s);
}
Console.ReadKey();
}
}