About how to block the right-click Copy code. There are several possible types:
<Head> input under the statement
- <Body onselectstart = "Return false;" oncontextmenu = "Return false;">
Add the following code at the bottom of the system homepage file (default. asp) and log file (article. asp). Both files are in the root directory.
- <NoScript>
- <IFRAME scr = "*. htm"> </iframe>
- </NoScript>
- <Script language = "JavaScript">
- Document. oncontextmenu = new function ("event. returnvalue = false ;");
- Document. onselectstart = new function ("event. returnvalue = false ;");
- </SCRIPT>
The advantage is that it is simple and easy to crack, but the protection is not enough.
Some methods are found:
First, JavaScript code that disables the right-click, Ctrl, and copy Functions
Some t website pages cannot use the right-click and copy functions, or even the ctrl key. How can this effect be achieved? In fact, it is easy to call a piece of JS Code.
The following text box shows the Code required to achieve the effect:
- Function click (e ){
- If (document. All ){
- If (event. Button = 1 | event. Button = 2 | event. Button = 3 ){
- Oncontextmenu = 'Return false ';
- }
- }
- If (document. layers ){
- If (E. Which = 3 ){
- Oncontextmenu = 'Return false ';
- }
- }
- }
- If (document. layers ){
- Document. captureevents (event. mousedown );
- }
- Document. onmousedown = click;
- Document. oncontextmenu = new function ("Return false ;")
- VaR travel = true
- VaR hotkey = 17/* hotkey is the key value of the hotkey, which is an asii code. Here 99 represents the C key */
- If (document. layers)
- Document. captureevents (event. keydown)
- Function Gogo (E)
- {If (document. layers ){
- If (E. Which = hotkey & travel ){
- Alert ("Operation error. Maybe you have pressed the wrong button! ");}}
- Else if (document. All ){
- If (event. keycode = hotkey & travel) {alert ("Operation error. Maybe you have pressed the wrong button! ");}}
- }
- Document. onkeydown = gogo
Save the above Code as a JS file, and then use <! -- # Include file = "*. js" --> you can call it. * indicates the file name you saved!
Disable right-click and automatically navigate
Script description:
Add the following code to the <body> area:
- <Script language = "JavaScript">
- If (navigator. appname. indexof ("Internet Explorer ")! =-1)
- Document. onmousedown = nosourceexplorer;
- Function nosourceexplorer ()
- {
- If (event. Button = 2 | event. Button = 3)
- {
- Alert ("right-click prohibited... go to the homepage! ");
- Location. Replace ("http://xiaoc.icpcn.com ");
- }
- }
- </SCRIPT>
Third, disable right-click code
Add the following code between head and head.
- <Script language = "JavaScript">
- Document. oncontextmenu = new function ("event. returnvalue = false ;");
- Document. onselectstart = new function ("event. returnvalue = false ;");
- </SCRIPT>
The advantage is that JS scripts are used, but they are complicated and easy to crack.
Recommended Methods:
Insert the following code into the webpage script (header. asp:
- <Body oncontextmenu = 'Return false' ondragstart = 'Return false' onselectstart = 'Return false' onselect = 'document. selection. empty () 'oncopy = 'document. selection. empty () 'onbeforecopy = 'Return false' onmouseup = 'document. selection. empty () '>
The code above indicates that it is blank when the mouse selects text
The advantage is that the Code is easy to implement without the support of JS scripts. In addition, the clipboard is also cleared after normal cracking and replication.
Here, I remove onmouseup = 'document. selection. empty () ', because this Code indicates that when the mouse key pops up, the selected content is blank, which will affect normal login.