您的位置:首页 > 编程语言 > C#

C#读写快捷方式(.lnk文件)

2011-04-13 12:35 1146 查看

[C#]

引用COM组件Windows Script Host Object Model;
IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShellClass();
IWshRuntimeLibrary.IWshShortcut shortcut =(IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut("c://a.lnk");
shortcut.TargetPath = "指向地址.exe";
shortcut.Arguments = "参数";
shortcut.Description = "我是快捷方式名字哦!";
shortcut.Hotkey = "CTRL+SHIFT+N";
shortcut.IconLocation = "notepad.exe, 0";
shortcut.Save();
读取也一样的,上面的几个设置都是属性。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: