www.RickLaFleur.com

 

Register Application as a Url Protocol

There are times when it is appropriate for an application to be called via a URL and be passed data, such as "myprotocol://open?id=100”. The following code shows how an application can self register itself to handle a URL protocol.

  
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();
    }
}

Labels: ,


Comments:
http://markonzo.edu Great site. Keep doing., ashley furniture price [url=http://jguru.com/guru/viewbio.jsp?EID=1536072]ashley furniture price[/url], uyqtmhr, allegiant air verdict [url=http://jguru.com/guru/viewbio.jsp?EID=1536075]allegiant air verdict[/url], eupxr, pressure washers info [url=http://jguru.com/guru/viewbio.jsp?EID=1536078]pressure washers info[/url], vsraoc, dishnetwork blog [url=http://jguru.com/guru/viewbio.jsp?EID=1536080]dishnetwork blog[/url], :-\, adt security preview [url=http://jguru.com/guru/viewbio.jsp?EID=1536076]adt security preview[/url], vgscjtp,
 
http://lumerkoz.edu Technologies list, http://www.comicspace.com/esomeprazole/ niger inshallahbut http://www.comicspace.com/paroxetine/ likewise http://soundcloud.com/furosemide biscuit economica http://barborazychova.com/members/Buy-Premarin.aspx destefano bagging http://rc8forum.com/members/Buy-Zofran.aspx overextra
 
Post a Comment



Links to this post:

Create a Link



<< Home

Archives

January 2007  |   March 2007  |   May 2007  |   February 2008  |   April 2008  |   July 2008  |   September 2008  |   October 2008  |   December 2008  |   January 2009  |   April 2009  |   May 2009  |   June 2009  |   December 2009  |   January 2010  |  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]