VBSCRIPT 语法简单 强大 但是功能上明显不足 需要第三方的控制 e.g. COM 组件来扩展其功能. VBSEDIT 安装完之后就可以在安装目录下发现 免费提供的 COM 组件 vbs toolkit.

下载 VBSEDIT 工具

32 位 DLL: vbsedit32 60 VBSEdit 提供
64 位 DLL: vbsedit64 61 VBSEdit 提供

注册组件

注册组件需要管理员权限. 可以运行下面命令分别注册 32, 64 位的VBSEDIT 工具箱.

regsvr32 vbsedit32.dll
regsvr32 vbsedit64.dll

注销的时候则需要 加 /u 参数

regsvr32 /u vbsedit32.dll
regsvr32 /u vbsedit64.dll

提供了一些方便的功能扩展 比如剪贴板.

Set toolkit = CreateObject("VbsEdit.Toolkit")
toolkit.PutClipboardText "Hello World" 
WScript.Echo toolkit.GetClipboardText() 

CLIPBOARD OPERATIONS

GetClipboardText method

1、获取剪切板中的文本内容

Set toolkit = CreateObject("VbsEdit.Toolkit")
WScript.Echo toolkit.GetClipboardText() 

PutClipboardText method

2、将指定内容设置到剪切板中

Set toolkit = CreateObject("VbsEdit.Toolkit")
toolkit.PutClipboardText "Hello World"

运行后就将剪切板的数据设置为 Hello World

DIALOG BOXES

OpenFileDialog method
Prompt the user to open a file
toolkit.OpenFileDialog ([initialFolder,[filters,[multiselect,[title]]]])

'Opens a single file
Set toolkit = CreateObject("VbsEdit.Toolkit")
files=toolkit.OpenFileDialog("c:\scripts\","Text Files (*.txt)|*.txt",False,"Open a text file")
If UBound(files)>=0 Then
 WScript.Echo files(0)
Else
 Wscript.Quit
End If
 
'Opens multiple files
Set toolkit = CreateObject("VbsEdit.Toolkit")
files=toolkit.OpenFileDialog("c:\scripts\","Text Files (*.txt)|*.txt",True,"Open a text file")
If UBound(files)>=0 Then
 For Each filepath In files
  WScript.Echo filepath
 Next
Else
 Wscript.Quit
End If

上面的代码就是打开只可以输入一个文件的对话框,第二段就是可以选择多个文件的对话框

SaveFileDialog method

Prompt the user to save a file
toolkit.SaveFileDialog ([initialFolder,[initialFilename,[filters,[title]]]])

Set toolkit = CreateObject("VbsEdit.Toolkit")
filepath = toolkit.SaveFileDialog("c:\scripts","test.txt","Text Files (*.txt)|*.txt")
 
If Not(IsNull(filepath)) Then
 Set objFSO = CreateObject("Scripting.FileSystemObject")
 Set objFile = objFSO.CreateTextFile(filepath,True)
 objFile.WriteLine Date
 objFile.Close
Else
 Wscript.Quit
End If

上面的代码就是另存为 文本文件对话框

SelectFolder method

Prompt the user to select a folder
toolkit.SelectFolder ([initialDir,[title]])

Set toolkit = CreateObject("VbsEdit.Toolkit")
myfolder=toolkit.SelectFolder("c:\scripts\","Please select a folder")
 
If Not(IsNull(myfolder)) Then
 WScript.Echo myfolder
Else
 Wscript.Quit
End If

上面的就是浏览文件夹对话框

ENUMERATING WINDOWS

TopLevelWindows method
Enumerates top level windows

Set toolkit = CreateObject("VbsEdit.Toolkit")
For each window in toolkit.TopLevelWindows()
 WScript.Echo window.WindowTitle
 WScript.Echo window.ProcessId
Next

枚举顶级窗口

Window object

ClassName
Retrieves the name of the class to which the specified window belongs.

WindowTitle
Retrieves the title of the specified window's title bar or the text of the control if the specified window is a control.

DlgCtrlID
Retrieves the identifier of the specified control.

Height
Retrieves the height of the specified window.

Width
Retrieves the width of the specified window.

X
Retrieves the X coordinate of the upper-left corner of the specified window.

Y
Retrieves the Y coordinate of the upper-left corner of the specified window.

IsVisible
Determines the visibility state of the specified window.

ProcessId
Retrieves the identifier of the process that created the specified window.

Click method
Sends a mouse click event to the specified window.
window.Click ([offsetX ,[offsetY]])
If offsetX and offsetY are not specified, the event is sent into the middle of the window.

SendText method
Sends text to the specified window.
window.SendText text

ChildWindows method
Enumerates the child windows that belong to the specified parent window.

–EOF (The Ultimate Computing & Technology Blog) —

标签:
vbs-toolkit,VBSEdit

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
评论“vbs-toolkit VBSEdit 提供 免费的COM组件”
暂无“vbs-toolkit VBSEdit 提供 免费的COM组件”评论...

《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线

暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。

艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。

《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。