C# Backing Up And Restoring Clipboard
问题 I have a program that uses clipboard but I want to restore the clipboard to its former state after I am done with it. This is my code : IDataObject temp = Clipboard.GetDataObject(); //Some stuff that change Cliboard here Clipboard.SetText("Hello"); //Some stuff that change Cliboard here Clipboard.SetDataObject(temp); But it if I copy a text, and run this code, I get nothing on notepad. NOTE : I can't use Clipboard.Contains because I want to preserve the Clipboard EXACLY how it was before,