DotNet 4.0 Clipboard Error?

Try the following:
1. Create an application in VS Express Edition 2010 (.NET 4.0).
2. Put these lines in the code wherever u -

        string text = Clipboard.GetText();
        MessageBox.Show(text);

3. Copy some ANSI text (for simplicity) from notepad.
4. Launch the application and see the result.

I see "Clipboard.GetText ()" (without quotes) instead of the actual data!

Can anyone confirm that this is happening in Pro / Ultimate versions?

+3
source share
1 answer

Try this and post your results:

string text = Convert.ToString(Clipboard.GetData(System.Windows.Forms.DataFormats.Text));
MessageBox.Show(text);
+2
source

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


All Articles