Sometimes it doesn't work, the text in the variable 'text' cannot be placed on the clipboard. Is there a more stable solution for the following code?
string text = "hello";
clipboard.text = text; e2.SendKeys("Ctrl+A", "Ctrl+V");
I often use the following method, which works,
but I don't know why the clipboard doesn't save the text on the first attempt.
string text = "hello";
__L:
clipboard.text = text;
try
{
e.SendKeys("Ctrl+A", "Ctrl+V");
//....
}
catch (Exception er) { print.it(er); goto __L; }
string text = "hello";
clipboard.text = text; e2.SendKeys("Ctrl+A", "Ctrl+V");
I often use the following method, which works,
but I don't know why the clipboard doesn't save the text on the first attempt.
string text = "hello";
__L:
clipboard.text = text;
try
{
e.SendKeys("Ctrl+A", "Ctrl+V");
//....
}
catch (Exception er) { print.it(er); goto __L; }