/// <summary>
/// 建立快捷鍵方式的方法
/// </summary>
/// <param name="lnkName">快捷鍵方式的名稱</param>
/// <param name="appPath">目標程序的絕對路徑</param>
/// <param name="winStyleID">窗體風格標誌 0:普通,3:最大,7:最小</param>
/// <param name="description">快捷鍵方式的描述</param>
/// <param name="iconPath">快捷鍵圖標的絕對路徑</param>
/// <param name="hotKey">快捷鍵</param>
public static void CreShortCut(string lnkName, string appPath, int winStyleID, string description,string iconPath,string hotKey)
{
if(!lnkName.ToLower().Contains(".lnk"))
{
lnkName = lnkName + ".lnk";
}
WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) +
"\\" + lnkName
);
shortcut.TargetPath = appPath;
shortcut.WorkingDirectory = appPath.Substring(0,appPath.LastIndexOf("\\"));
shortcut.WindowStyle = winStyleID;
shortcut.Description = description;
shortcut.IconLocation = iconPath;
shortcut.Hotkey = hotKey;
shortcut.Save();
}shell