您的位置:首页 > 移动开发 > Objective-C

引用COM组件Windows Script Host Object Model,创建快捷方式

2004-12-27 08:22 423 查看
string dk =System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop);//得到桌面文件夹
IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShellClass();
IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(@dk+"//a.lnk");
shortcut.TargetPath = @"C:/Program Files/Internet Explorer/IEXPLORE.EXE";
shortcut.Arguments = "http://localhost/2005/bay";
shortcut.Description = "My Shortcut";
shortcut.Hotkey = "CTRL+SHIFT+N";
shortcut.IconLocation = "notepad.exe, 0";
shortcut.Save();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: