asp.net 桌面快捷方式

2017 年 5 月 26 日3460

【IT168技术文档】

asp.net项目安装程序添加快捷方式





//添加以下引用:COM 下 Windows Script Host Object Model,然后



//using System.Runtime.InteropServices;



//using IWshRuntimeLibrary; AddShortcut()



{



);



];



try



{



url;



//创建收藏夹快捷方式;



IWshShell_Class wshShell favShortcut.TargetPath = mysite;



favShortcut.Save();//保存快捷方式



//创建桌面快捷方式;



IWshURLShortcut desktopShortcut IWshURLShortcut;



desktopShortcut.TargetPath = mysite;



desktopShortcut.Save();//保存快捷方式 }



catch (Exception exc)



{



exc.Message);



}



}



0 0