弱弱的问,这句代码怎么必定成C#代码,谢谢!

acuter 2004-11-13 09:47:08
小弟初学,实在不清楚。
谢谢大虾帮忙!

Set WshShell = CreateObject("WScript.Shell")
...全文
83 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
OneDotRed 2004-11-13
  • 打赏
  • 举报
回复
引用COM组件Windows Script Host ,下面是我将MSDN
ms-help://MS.MSDNQTR.2003FEB.2052/enu_kbscripting/en-us/scripting/Q242297.htm
的部分代码改成C#代码:


IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShellClass();
IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut( "C:\\a.lnk" );
shortcut.TargetPath = "notepad.exe";
shortcut.Arguments = "C:\\a.txt";
shortcut.Save();

shortcut = null;
网淘那些事 2004-11-13
  • 打赏
  • 举报
回复
帮你顶!

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧