This example describes the use of Clipboarddata objects in JavaScript. Share to everyone for your reference. The specific analysis is as follows:
Clipboarddata object, note that the Clipboard in the Web page can only be set text type, that is, only text can be copied
ClearData ("Text") Empty the Pasteboard
GetData ("Text") reads the value of the Pasteboard
SetData ("Text", Val) set the value of the Pasteboard
When the body's Oncopy event is triggered when copying, the direct return false is to prohibit copying, note that the text in the page cannot be copied.
Many elements also have oncopy,onpaste events
1. Copy Text to Clipboard
?
| 1 2 3 4 5 6 7 8 9 10 11 12 13-14 |
|
2. Prohibit copying, and prohibit pasting
?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
3.clipboardData object Add source when copying
?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16-17 |
|
I hope this article will help you with the C # program.