Pacman Pacman - 7 months ago 50
C# Question

Getting clipboard data from remote computer

Using C#, is there a way to get the clipboard data that is on a remote machine ?
I am remoting into another computer using Remote Desktop, I run an application on it that copies some text onto the clipboard, from my desktop I have a C# winform application that needs to make use of the clipboard data on that remote machine.

Is there a way to do that ?


You can use the Clipboard object in C#, Refer:

//Set data to clipboard
Clipboard.SetData(format, users);
//Get data from clipboard
List<User> result = null;
if (Clipboard.ContainsData(format)){
    result = (List<User>)Clipboard.GetData(format);
//Clear clipboard