This is the function I'm using
public String ClipboardGet()
{
IDataObject dataObj = Clipboard.GetDataObject();
if (!dataObj.GetDataPresent(DataFormats.Text))
return "";
return dataObj.GetData(DataFormats.Text).ToString();
}
but sometimes it returns a empty string even when the data is text, how to handel this?
Have you tried Clipboard.GetText or IDataObject.GetDataPresent(string, bool)?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With