C#储蓄,然后通过剪贴板retriving数据 [英] C# saving and then retriving data via the clipboard

查看:112
本文介绍了C#储蓄,然后通过剪贴板retriving数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,

所以我有一个程序,可以自动将数据复制到剪贴板,然后到内存中。我想要做的是,以保存上之前,我的程序运行,然后,一旦我已经完成了我需要做的copyit回剪贴板剪贴板中的数据。

So I have a program that automatically copies data to the clipboard and then into memory. What I want to do is, to save the data that is on the clipboard prior to my program running and then to copyit back to the clipboard once I have finished what I need to do.

我可以得到的数据fromt他剪贴板这样:

I can get the data fromt he clipboard as such:

IDataObject currentClipboard = Clipboard.GetDataObject();



不过,当我想要把数据传回到剪贴板中,我需要知道什么这些数据在格式上投它?

However, when I want to put the data back on to the clipboard, do I need to know what format that data is in to cast it?

有没有办法做到这一点?

Is there a way to do this?

谢谢。

推荐答案

请参阅这篇文章,可能你需要什么:

See this post, it might have what you need:

奇诡与剪贴板访问

这篇关于C#储蓄,然后通过剪贴板retriving数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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