问题
I'm trying to hold down CTRL while C is pressed but I can't get it work. I've read SendKeys Class but still, it doesn't work.
Thats what I've tried:
SendKeys.SendWait("^C");
SendKeys.SendWait("{^C}");
SendKeys.SendWait("^{C}");
SendKeys.SendWait("^(C)");
SendKeys.SendWait("(^{C})");
回答1:
You need to put in parenthesis. Example:
SendKeys.SendWait("^(c)");
Notice that c should be lowercase. It is case sensitive
回答2:
use + instead of ^ for shift and put in parenthesis. (^ for control and + for shift; in your question you said shift). And remember c must be in lowercase.
SendKeys.SendWait("+(c)");
回答3:
If you're trying to do SHIFT while pressing C, you're using the wrong codes. ^ is CTRL. Shift is +.
来源:https://stackoverflow.com/questions/9789214/sendkeys-sendwait-method-in-c-emulating-ctrlc