Clears the Clipboard and then adds text data in the TextDataFormat.Text or TextDataFormat.UnicodeText format, depending on the operating system.
This method adds text data in the TextDataFormat.UnicodeText format on WinXpFamily and Win2kFamily. Otherwise, this method adds text data in the TextDataFormat.Text format.
To retrieve text data from the Clipboard, first use the erload:System.Windows.Forms.Clipboard.ContainsText method to determine whether the Clipboard contains text data before retrieving it with the erload:System.Windows.Forms.Clipboard.GetText method.
The System.Windows.Forms.Clipboard class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your Main method is marked with the STAThreadAttribute attribute.