My script selects the text itself on a specific site, and it is necessary that this selected text be copied to the clipboard. How to use the code to press Ctrl + C ? I work in Visual Studio, C #.

  • UI Automation will handle this perfectly. Here is an example . - VladD

2 answers 2

text = document.selection.createRange().text; Clipboard.SetText(text); 
  • Try to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky

I think that this problem is solved through WinApi.

For example, here is an example in C ++

https://stackoverflow.com/questions/16295677/winapi-c-simulate-button-clicked-with-window-handle

But in C # there won't be many differences ...