本帖最后由 os51 于 2016-7-30 16:06 编辑
[C#] 纯文本查看 复制代码 namespace SendKeyWait{
using System;
using System.Windows.Forms;
public class Program
{
[STAThread]
private static void Main(string[] args)
{
int timeout = 0;
try
{
x = Convert.ToInt32(args[0]);
System.Threading.Thread.Sleep(x);
for (int i = 1; i < args.Length; i++) {SendKeys.SendWait(args[i].Replace("\r\n", "{ENTER}"));}
}
catch
{
Environment.Exit(-1);
}
}
}
}
用法: SendKeyWait 300 abcdef
300为延时,单位毫秒
骂人方法:
批处理:for /f "tokens=* eol=; delims=" %%i in (text.txt) do SendKeyWait 500 %%i &SendKeyWait 500 {ENTER}
命令行直接输入:for /f "tokens=* eol=; delims=" %i in (text.txt) do SendKeyWait 500 %i &SendKeyWait 500 {ENTER}
text.txt为内容,一行一个
编译:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe" SendKeyWait .cs |