tags:

views:

111

answers:

2

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?

+1  A: 

Try this instead and post your results:

string text = Convert.ToString(Clipboard.GetData(System.Windows.Forms.DataFormats.Text));
MessageBox.Show(text);
Ian P
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
A: 
string text = Clipboard.GetText();
MessageBox.Show(text);

This code has been tested on Express Edition and Ultimate edition.

Both contain bug regarding Clipboard.GetText method. It doesn't return right value/text content. Those who report that Professional Edition is not buggy, please check again with screen-shots.


Ultimate Edition bug shot Ultimate Edition bug shot

Thanks!

Nayan