I wrote a program automatically send text, logic is simple: the sending of text into the clipboard, and then send out,
I am put clipboard operation in the DLL, generally no problem, also don't know which programs and conflict, or what's the matter, sometimes will throw this exception.
I checked on the net a circle, as if the shear plate with the handle to the window and relationship? !
I put this code rewritten in the main program, will be ok? Feel puzzling...
Private void Fun2 (string pString)
{
//LkfClipboard saveClip ();
//Clipboard. SetDataObject (pString, true);
//Utils. DelayMilliseconds (100);
Clipboard. SetText (pString);
Thread.sleep (1000);
//Utils. DelayMilliseconds (100);
//string strData=(https://bbs.csdn.net/topics/GetTxtClipboard);
LKFcombinatorialKeyDownUp (new FunctionalKeysName [1] {FunctionalKeysName. Leftcontrol}, new KeyboadName [1] {KeyboadName. V});
Utils. DelayMilliseconds (200);
The Clipboard. The Clear ();
//LkfClipboard restoreClip ();
}
CodePudding user response:
If your code in the loop frequently accessed clipboard?Can try to reduce the frequency or exception handling, and then ignore this mistake
CodePudding user response: