Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get the My.Computer.Clipboard data to bytes.
Posted
Comments
Md. Rashim Uddin 27-Sep-11 7:05am    
Mark an answer as correct.

Try it in VB
Clipboard backup in C#[^]
 
Share this answer
 
Depends on what type of data is on the clipboard: you should check before you fetch it. See MSDN: http://msdn.microsoft.com/en-us/library/system.windows.forms.clipboard.getdataobject.aspx[^]
 
Share this answer
 
Could you please try with that,

C#
IDataObject data = Clipboard.GetDataObject();
string str = Convert.ToString(data.GetData(DataFormats.UnicodeText));
UTF8Encoding enc = new UTF8Encoding();
byte[] arr = enc.GetBytes(str);
 
Share this answer
 
v2
Comments
Md. Rashim Uddin 2-Oct-11 14:17pm    
Is it working for you?? if not please lemme know.

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