CmisSync.Shortcut.Create C# (CSharp) Method

Create() public method

public Create ( string file_path, string target_path ) : void
file_path string
target_path string
return void
        public void Create(string file_path, string target_path)
        {
            link = (IShellLink)new ShellLink();

            // Setup shortcut information.
            link.SetDescription(Description);
            link.SetPath(file_path);

            // Save the shortcut information.
            IPersistFile file = (IPersistFile)link;
            file.Save(target_path, false);
        }

Same methods

Shortcut::Create ( string file_path, string target_path, string icofile, int icoidx ) : void

Usage Example

Example #1
0
        /// <summary>
        /// Add CmisSync to the user's Windows Explorer bookmarks.
        /// </summary>
        public override void AddToBookmarks()
        {
            string user_profile_path = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
            string shortcut_path = Path.Combine(user_profile_path, "Links", "CmisSync.lnk");

            if (File.Exists(shortcut_path))
                File.Delete(shortcut_path);

            Shortcut shortcut = new Shortcut();

            shortcut.Create(FoldersPath, shortcut_path, Forms.Application.ExecutablePath, 0);
        }
All Usage Examples Of CmisSync.Shortcut::Create