Im using Clipboard.GetDataObject (); but sometimes it doesn't work as i need

This is function i using

    public String ClipboardGet()
    {
        IDataObject dataObj = Clipboard.GetDataObject();

        if (!dataObj.GetDataPresent(DataFormats.Text))
            return "";

        return dataObj.GetData(DataFormats.Text).ToString();
    }

but sometimes it returns an empty string, even when the data is text, has anyone received a suggestion on how to pass this?

+3
source share
1 answer

Source: https://habr.com/ru/post/1776674/


All Articles