3

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

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

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

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

Can anyone confirm if this happens in Pro/Ultimate editions too?

Nayan
  • 3,092
  • 25
  • 34

1 Answers1

2

Try this instead and post your results:

string text = Convert.ToString(Clipboard.GetData(System.Windows.Forms.DataFormats.Text));
MessageBox.Show(text);
Allen Rice
  • 19,068
  • 14
  • 83
  • 115
Ian P
  • 12,840
  • 6
  • 48
  • 70
  • This (after typecasting) works. But then it must be a bug because all the functions that are public should work according to definition and documentation. Weird. – Nayan May 04 '10 at 15:31