I am trying to get a link which was generated on click and pasted in my clipboard. I tried everything I could find. But I always recieve "null", even though when I paste the link manually in a notepad and what not, I get it.
I tried this code with every defined Dataformat, but everything returned null.
string clipboardText = Clipboard.GetDataObject().GetData(DataFormats.Text).ToString();
From MSDN: To use this class, ensure that your Main method is marked with the STAThreadAttribute attribute.
Example: