Using clipboard with console applications

Clipboard is a windows object. If you want to use clipboard in your .NET framework console applications you must reference `System.Windows.Forms` and mark your main method with `STAThreadAttribute` attribute.

Then you can use this class's methods e.g. Clipboard.SetText("some text to store in the clipboard");

Happy coding.

Posts created 141

Leave a Reply

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top