string url = @"http://www.ricklafleur.com";
Process.Start("rundll32.exe", "url.dll,FileProtocolHandler \"" + url + "\"");
A halfhearted blog about one guys experiences and thoughts with a few code snips thrown in. Includes topics such as travel, motorcycles, programming, New York City, and anything that interests me enough to document.
string url = @"http://www.ricklafleur.com";
Process.Start("rundll32.exe", "url.dll,FileProtocolHandler \"" + url + "\"");
public void RegisterUrlProtocol(string myUrlProtocolName, bool force,)
{
RegistryKey rKey = Registry.ClassesRoot.OpenSubKey(myUrlProtocolName, true);
if (force || rKey == null)
{
rKey = Registry.ClassesRoot.CreateSubKey(myUrlProtocolName);
rKey.SetValue("", "URL:"+ myUrlProtocolName+" Protocol");
rKey.SetValue("URL Protocol", "");
rKey = rKey.CreateSubKey(@"shell\open\command");
rKey.SetValue("", "\"" + Application.ExecutablePath + "\" %1");
}
if (rKey != null) { rKey.Close();
}
}