- 超级版主
- 1228894
- 26975
- 25
- 8050 朵
- 36129 个
- 4746 个
- 421340
- 2012-07-18
|
1#
t
T
发表于 2022-03-07 22:05
|
|只看楼主
姿势1:SayString 姿势2: QTP按键 Set wshobj = CreateObject("WScript.Shell") str="1234Sdfg/" For i=1 To Len(str) wshobj.SendKeys "{"&mid(str,i,1)&"}" Next Set wshobj = Nothing 姿势3:命令库KeyList - Call lib.键盘.KeyList("1234Sdfg/",0,50)
复制代码姿势4:ASCII - txt = "这是个测试"
- Call sendstring(txt)
- Sub sendstring(str)
- Dim i, j, t
- For i = 1 To len(str)
- t = asc(mid(str, i, 1)) + 65536
- KeyDown 18,1
- For j = 1 To len(t)
- KeyPress "Num " & mid(t, j, 1), 1
- Next
- KeyUp 18,1
- Next
- End Sub
复制代码姿势5:ASCII带编码格式 - TracePrint SendString("每一天", 50, "ANSI" )
- Function SendString(发送内容, 发送延迟, 文字编码类型)
- If 文字编码类型 = "ANSI" Or 文字编码类型 = "Unicode" Then
- Dim str, 字符编码,i, k
- str = 发送内容
- For i = 1 To Len(str)
- If 文字编码类型 = "ANSI" Then
- 字符编码 = Asc(Mid(str, i, 1))
- Elseif 文字编码类型 = "Unicode"
- 字符编码 = AscW(Mid(str, i, 1))
- End If
- If 字符编码 < 0 Then
- 字符编码 = 字符编码 + 65536
- End If
- KeyDown 18, 1
- For k = 1 To Len(字符编码)
- KeyPress Asc(Mid(字符编码, k, 1)) + 48, 1
- Next
- KeyUp 18, 1
- Delay 发送延迟
- Next
- SendString=1
- Else
- SendString=0
- End If
- End Function
复制代码姿势6:粘帖 - Call Plugin.Sys.SetCLB("每一天")
- Delay 50
- Call lib.键盘.键盘组合键("Ctrl + V",0)
复制代码
|