使用SendKeys在VBScript中“键入”变量

时间:2015-09-30 15:28:42

标签: vbscript

SendKeys可以输入变量吗?例如

Set ws = CreateObject("WScript.Shell")
Set TypeThis = I Want it to type whats here
ws.SendKeys [I want it to type the variable(TypeThis]
ws.SendKeys "{ENTER}"
Wscript.sleep 100

1 个答案:

答案 0 :(得分:0)

只需将变量作为参数传递给set方法。如果要为变量赋值,则不应使用关键字Set ws = CreateObject("WScript.Shell") typeThis = "I Want it to type whats here" ws.SendKeys typeThis WScript.sleep 1000 。仅在要为对象分配引用时使用它。

//FieldController
public ActionResult Field()

//Views
Field