简体   繁体   English

Clipboard.GetText

[英]Clipboard.GetText

when i select and copy this glyph from email message: £ (0x00a3) 当我从电子邮件中选择并复制此字形时:£(0x00a3)

and then run: 然后运行:

message=Clipboard.GetText();
if(message==""){
    Console.WriteLine("There is nothing on your clipboard.");

            Environment.Exit(0);
        }
    else{ Console.WriteLine(message); }

reports: "nothing on clipboard" 报告:“剪贴板上什么都没有”

seems that all glyphs between 00a1-00ff exhibit same behavior. 似乎所有在00a1-00ff之间的字形都表现出相同的行为。

I've looked at overloads for Clipboard.GetText ... to no avail. 我看过Clipboard.GetText的重载...无济于事。

Try with 试试看

   message=Clipboard.GetText(TextDataFormat.UnicodeText);

The TextDataFormat.UnicodeText specifies the standard Windows Unicode text format. TextDataFormat.UnicodeText指定标准的Windows Unicode文本格式。
However also with a simple GetText I am not experiencing the missing char 但是,即使使用简单的GetText,我也不会遇到缺少的字符

Clipboard.SetText("£");
string s = Clipboard.GetText();
Console.WriteLine(s);

I get back the £ char. 我回来了£字符。 (By the way it is 0x00A3) (顺便说一下,它是0x00A3)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM