邀请Windows script版本不是5.7的朋友测试一下

wtogether 2010-05-02 10:47:46
版本查看用命令提示符,输入:cscript,然后回车,结果第一行为:
Microsoft (R) Windows Script Host Version [版本号]

这里想对ASP类的公共属性做个测试,使用的属性名是vbs保留字:Get,Script 5.7测试通过,不知道其他版本怎么样,所以想请其他Windows OS的朋友帮忙测试一下

文件保存为vbs文件,例如:test.vbs,然后命令提示符号进入test.vbs所在目录,输入cscript test.vbs,回车运行

Class ClassImpl

Public Property Get [Get](ByVal name)
[Get] = "Hello " & name
End Property

Public Property Let [Get](ByVal name, ByVal value)
WScript.Echo "Hello " & name & ": " & value
End Property
End Class

Dim cls
Set cls = New ClassImpl
cls.Get("wtogether") = "All right"
WScript.Echo cls.Get("wtogether")
Set cls = Nothing
...全文
105 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzp4881 2010-05-03
  • 打赏
  • 举报
回复
Microsoft (R) Windows Script Host Version 5.8
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。

Hello wtogether: All right
Hello wtogether
mrshelly 2010-05-03
  • 打赏
  • 举报
回复

Microsoft (R) Windows Script Host Version 5.6
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。

Hello wtogether: All right
Hello wtogether

wtogether 2010-05-03
  • 打赏
  • 举报
回复
非常感谢,终于可以用保留字来做类的方法了

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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