I. Anti-copy and paste:
<% 'Role: Text anti-copy garbled Function
'Date: 2006-3-6
'Author: blue2004
'The STR parameter is the original text, and the str1 author is yourself. reslut generates garbled seeds.
Function readtocode (STR, str1, result)
Dim name
Dim I, J, K
If isnull (STR) then
Readtocode = ""
Exit Function
End if
Randomize
K = instr (STR, "</P> ")
Do while K> 0
Result = ""
For I = 0 to 19
J = int (128 * RND) + 1
If J = 60 or J = 62 then
J = J + 1
End if
Result = Result & CHR (j) 'to generate a random number.
Next
Result = "<span style = 'display: none'>" & Result & "</span>"
STR = Replace (STR, "</P>", Result & "<'/P>", 1, 1)
K = instr (STR, "</P> ")
Loop
STR = Replace (STR, "<'/P>", "</P> ")
K = instr (STR, "<br> ")
Do while K> 0
Result = ""
For I = 0 to 19
J = int (128 * RND) + 1
If J = 60 or J = 62 then
J = J + 1
End if
Result = Result & CHR (j) 'to generate a random number.
Next
Result = "<span style = 'display: none'>" & Result & "</span>"
STR = Replace (STR, "<br>", Result & "<'br>", 1, 1)
K = instr (STR, "<br> ")
Loop
STR = Replace (STR, "<'br>", "<br> ")
Readtocode = STR & "<Div align = right style = 'color = gray '> [the copyright belongs to the original author and" & str1, reprinted, please specify the source] </div>"
End Function
Dim
A = "Hey, A <br> good news <p> Article </P> <br> <p> I agree, All rights reserved. </P>"
'Only for test
Response. Write ()
Dim B
'For the combined conversion, the size of string a is replaced with lower case
B = readtocode (lcase (a), "blue2004", "www.net.cn ")
'Output
Response. Write B
%>
Ii. Anti-collection
Prevents website content from being stolen and collected ASP code
<%
Dim appealnum, appealcount
Appealnum = 10' the same ip60 s request limit is 10 times
Appealcount = request. Cookies ("appealcount ")
If appealcount = "" then
Response. Cookies ("appealcount") = 1
Appealcount = 1
Response. Cookies ("appealcount"). expires = dateadd ("S", 60, now ())
Else
Response. Cookies ("appealcount") = appealcount + 1
Response. Cookies ("appealcount"). expires = dateadd ("S", 60, now ())
End if
If int (appealcount)> int (appealnum) then
Response. Write "It is very tiring to capture. Please wait for a while! "
Response. End
End if
%>
Anti-collection is required sooner or later. Keep this field for use now. Very practical