SendKeys.Send(“%”);不发送“%”符号

时间:2013-07-09 14:57:19

标签: c# .net-4.5

SendKeys.Send(“%”);不发送“%”符号

    while (true)
    {
        string a2 = @"%%asdf%%";
        foreach (char a in a2)
        {
              SendKeys.Send(a.ToString());
        }
        System.Threading.Thread.Sleep(1000);
    }

1 个答案:

答案 0 :(得分:11)

来自MSDN

  

加号(+),插入符号(^),百分号(%),代字号(〜)和   括号()对SendKeys有特殊含义。指定其中一个   这些字符将其括在大括号({})中。

SendKeys.Send也接受一个字符串。

为什么不呢:

string a2 = @"{%}{%}asdf{%}{%}";
SendKeys.Send(a2);
相关问题