my devel

my devel

  • NA
  • 89
  • 0

Create URL shortcut on Client desktop

Sep 17 2010 12:16 PM
Hi there,
do you know how can i create shortcut with my desire picture on client desktop, currently I can create a shortcut on the desktop when the visitor click on the Button but it's created by the default icon, not my icon.
I google it and found this code, but as i mentioned it does not create my picture.

Thanks in advanced

using IWshRuntimeLibrary;

private void urlShortcutToDesktop(string linkName, string linkUrl)
   {
        string deskDir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);

        using (StreamWriter writer = new StreamWriter(deskDir + "\\" + linkName + ".url"))
        {
            writer.WriteLine("[InternetShortcut]");
            writer.WriteLine("URL=" + linkUrl);
            writer.Flush();
        }
    }

protected void Button1_Click(object sender, EventArgs e)
    {
        urlShortcutToDesktop("Shortcut_Name", "http://www.yourdomian.com");
    }