2013-07-09 76 views
-2

SendKeys.Send(「%」);不發送 「%」 符號SendKeys.Send(「%」);不發送「%」符號

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

'-1'毫無[研究工作(https://www.google.com/search?q=sendkeys+percent+sign) –

+1

現在,這將是在未來更容易研究。 – Dan

+0

但是這篇文章現在有256個觀衆。 –

回答

11

MSDN

加號(+),插入符號(^),百分號(%),波浪號(〜),以及 括號( )對SendKeys有特殊的含義。要指定這些字符的其中之一,請將其括入大括號({})中。

SendKeys.Send也需要一個字符串。

那麼,爲什麼不:

string a2 = @"{%}{%}asdf{%}{%}"; 
SendKeys.Send(a2);