Access the Windows Clipboard

The clipboard is a set of functions and messages that can be used to transfer data between different windows applications. This is possible since all applications have access to it. We can manipulate data from the Windows clipboard through the .NET framework.

The code sample below shows how to access an image from the clipboard and save it to a file.

We can use the System.Windows.Forms.Clipboard class, which provides methods to save data to the system clipboard and retrieve data from it.

All methods of this class are static, so we don’t have to create an instance of it and everybody has serialized access to it.

The GetDataObject() method is the method that gets all the data from the clipboard.The other method GetDataPresent()