如何在Web prgram中使用Clipboard.GetDataObject() [英] how to use Clipboard.GetDataObject() in a web prgram

查看:173
本文介绍了如何在Web prgram中使用Clipboard.GetDataObject()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IDataObject data = Clipboard.GetDataObject();
//the value of data is null,and Clipboard.GetDataObject() dosen''t work
//my program is a web prgram
//I''m sure there are some data in my clipboard
if (data.GetDataPresent(DataFormats.Bitmap))
{
 System.Drawing.Image image = (System.Drawing.Image)data.GetData(DataFormats.Bitmap, true);
 image.Save("test.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}

推荐答案

请不要按"answer"进行评论.基于我以为你有答案的基础,我几乎没有读过这篇文章.

您应该了解ASP.NET.简短版,您的C#在服务器上运行,因此您只能与服务器上的剪贴板进行交互,而不能与客户端上的剪贴板进行交互.您想要的赔率接近零,因此答案是,您不能.
Please don''t push ''answer'' to comment. I almost did not read this, on the basis that I assumed you had an answer.

You should learn about ASP.NET. Short version, your C# runs on the server, and therefore you can only interact with the clipboard on the server, not the clipboard on the client. The odds are close to zero that you want this, and therefore, the answer is, you can''t.


这篇关于如何在Web prgram中使用Clipboard.GetDataObject()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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