Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
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);
}
Posted
Updated 10-Jul-11 21:02pm
v2

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900