在Webform(C#)中使用剪贴板 [英] Use clipboard in Webform(C#)

查看:165
本文介绍了在Webform(C#)中使用剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Winform中使用剪贴板来保存图像,但是在Webform中却不能使用.
请帮助我解决此问题.可能还有其他方法可以解决.
非常感谢,

I used clipboard in winform to save image,but I can''t use in webform.
Please help me solve this problem.May be have other ways to do it.
Thanks a lots,

推荐答案

为什么要将图像保存到剪贴板?最好将图像转换为 Byte [] 并在需要时再次使用.剪贴板内容可能会被用户更改.

Why you want to save Image to Clipboard ? better to convert image in Byte[] and use it again whenever you want.clipboard contents may be changed by user.

//store image to byteArray
Byte[] objByte = System.IO.File.ReadAllBytes("\\Image FilePath");





//write byteArray to image
szFile = System.IO.File.WriteAllBytes("Image FilePath",objByte  );


这篇关于在Webform(C#)中使用剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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