using System.Windows.Forms;
string text = "Some text for the clipboard";
Clipboard.SetDataObject(text); //clipboard now has "Some text for the clipboard"
text = ""; //zap text so it can be reset...
IDataObject data = Clipboard.GetDataObject();
if(data.GetDataPresent(DataFormats.Text))
{
text = (String)data.GetData(DataFormats.Text);
//text is now back to "Some text for the clipboard"
}
获取和设置剪贴板的数据
最新推荐文章于 2025-07-04 10:05:53 发布
