Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道SendKeys.Send("test text {sleep 250} another test text");C#中是否有类似的东西。
SendKeys.Send("test text {sleep 250} another test text");
我知道我可以使用Thread.Sleep,但我从用户输入中获取了字符串,我无法知道我必须睡多少次。
Thread.Sleep
我不相信有一种方法可以SendKeys.Send()暂停中弦。
SendKeys.Send()
如果您从用户输入读取要发送的字符串,最好将此字符串解析为要发送和暂停的部分字符串列表。
即使用您的示例,您将有一个字符串列表:"text text "和" another test test" 一个睡眠间隔列表:250
"text text "
" another test test"
250
睡眠间隔列表自然总是比要发送的字符串列表短 1 项。