为什么不Clipboard.GetText工作? [英] Why doesn't Clipboard.GetText work?

查看:776
本文介绍了为什么不Clipboard.GetText工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

String str = Clipboard.GetText();



抛出异常。

throws an exception


未处理的异常'System.StackOverflowException'
发生在PresentationCore.dll中

An unhandled exception of type 'System.StackOverflowException' occurred in PresentationCore.dll

我如何避免这个问题。

推荐答案

您可以尝试:

Clipboard.GetText(System.Windows.Forms.TextDataFormat.Text)

或者看看这里:
Clipboard.GetText返回null(空字符串)

http://msdn.microsoft.com/es-en/library/system.windows.forms.clipboard.gettext.aspx

这篇关于为什么不Clipboard.GetText工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆