2019-8-31-C#-如何引用-WshShell-类

title author date CreateTime categories
C# 如何引用 WshShell 类
lindexi
2019-08-31 16:55:58 +0800
2019-3-19 9:6:10 +0800
C#

如果想要创建快捷方式等,很多使用都需要引用 WshShell 类,这个类需要通过 COM 的方法引用

引用 WshShell 不是在一个程序集,而是 Windows Script Host Object Model 一个 COM 组件,通过下面步骤可以引用

创建一个控制台项目,右击引用,添加 COM 请看下图

添加命名空间 using IWshRuntimeLibrary; 就可以使用了

参见 使用 C# 代码创建快捷方式文件 - walterlv

Windows Script Host: Scripting; Management Services

posted @ 2019-11-21 16:01  lindexi  阅读(54)  评论(0编辑  收藏  举报