Accessing the Clipboard

The clipboard can be accessed through the static Clipboard class methods GetData and SetData.

String text = (String) 
Clipboard.GetData(DataFormats.Text);
Clipboard.SetData(DataFormats.Text, text);

Test if text is present with

Clipboard.ContainsText()