Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The text cannot be placed on the clipboard
#1
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; }


Messages In This Thread
The text cannot be placed on the clipboard - by Davider - 03-29-2024, 05:15 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)