how can i backup the system clipboard?

Hackevin 2004-11-12 11:26:37
i have to use the system clipboard as a buffer, but i don't want to cleanup its contents.

how i can backup and restore what it has?

i try System.Windows.Forms.Clipboard, but there seems something wrong when i restore
the contents, that String[] dataFormArr = iData.GetFormats(); has some types missing.

and i want to know how i can do if the clipboard holds an image, wave or something.

thanks all
...全文
113 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jhtchina 2005-07-13
  • 打赏
  • 举报
回复
mark
xzhy80 2005-07-13
  • 打赏
  • 举报
回复
up
jimh 2004-11-12
  • 打赏
  • 举报
回复
c# use
object obj = Clipboard.GetDataObject(); //save system clipboard data to obj
Clipboard.SetDataObject(obj); restore data to clipboard
Hackevin 2004-11-12
  • 打赏
  • 举报
回复
up once
520NET 2004-11-12
  • 打赏
  • 举报
回复
LG
Hackevin 2004-11-12
  • 打赏
  • 举报
回复
thank you, jimmy

when i set the obj back to the clipboard, i get an exception of "requested clipboard operation failed"

and i have just tested the text

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧