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.GetTextorIDataObject.GetDataPresent(string, bool)?