Add characters randomly on the ASP page to implement anti-copy code

Source: Internet
Author: User

<%
'Role: Text anti-copy garbled Functions
'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 = "Ga ga, 1 Article <br> good <p>ArticleOh </P> <br> <p> I recommend that you steal it .. Guy from wood JJ, Jack .. </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.xxx.com ")

'Output
Response. Write B
%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.