您的位置:首页 > 其它

给windows应用程序创建快捷方式

2013-10-12 16:07 148 查看
static void Main()

{

WshShell shell = new WshShell();

IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(

Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) +
"\" + "Allen’s Application.lnk");

shortcut.TargetPath =
System.Reflection.Assembly.GetExecutingAssembly().Location;

shortcut.WorkingDirectory =
System.Environment.CurrentDirectory;

shortcut.WindowStyle = 1;

shortcut.Description = "Launch Allen’s Application";

shortcut.IconLocation = System.Environment.SystemDirectory + "\" +
"shell32.dll, 165";

shortcut.Save();

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

Application.Run(new Form1());

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: