ASP several use Skills _asp Foundation

Source: Internet
Author: User
Boolean data can also be transformed like this:
Share=true
Sharex=not (Sharex)
Response.Write Sharex
To get the result is false
A lot less if judged 15:49 2006-3-29
Insert contains ' (single quote) data:
Title=replace (title, "'", "" ")
Set Update=conn. Execute ("INSERT into Netcang (title) Values (' &title& ')")

Filter for passing parameters:
Digital type: CInt () or IsNumeric (), similar and CLng () ...

Limit IP voting:
For more stringent voting items, it is not possible to restrict IP voting only, and there are motives for the following:
1, replace the IP address (slow)
2, network packet analysis directly submitted (FAST)

VB has this technique:
This method is commonly used when checking whether a string is empty
If Text1.Text = "" Then
End If
If you use
If Len (Text1.Text) = 0 Then
End If
Efficiency will be greatly improved
What about the ASP? I haven't studied it, but I'll use the latter method later. 20:13 2006-3-29

ASP one word Trojan application conditions:
1, the database suffix for ASP or ASA can run the suffix (as the ASP file)
2, did not do the anti-download table processing
Therefore, now a word Trojan application environment is, some of the fledgling station or corporate site (producers for office workers, using DW to make ASP).

Increase access speed
The SQL statement writes the name segment as much as possible, and the select * from table is much slower than the Select id,filed from table
If you use a field more than once, assign it to a variable, such as:
ID=RS ("id")
First call to display:<%=id%><br>
The second call shows:<%=id%>
RS (0) is said to be faster than RS (ID).

Page load Time:
<%startime=timer ()
......
Endtime=timer ()
%>
Code Execution Time: <%=formatnumber ((endtime-startime) *1000,3)%> ms

Uploading files is always a security priority.

A breath of fresh air or exercise can spark inspiration.

Do the program as much as possible with your own things, such as a period of Ewebeditor editor vulnerabilities. If you are not concerned about security, many programmers do not know that their program is affected by him.

table field Settings
Whether it is a table or a field, the name of the best prefix, such as kuhanzhu_admin, so you can reduce a lot of negligence is not done tight injection prevention. There are injection tools can not guess, only by hand detection, undoubtedly increased the difficulty of injection detection.

Forums or friends can give you a lot of help and even provide you with highly efficient code.

Multi-user systems such as forums or systems that can be registered, pay attention to the problem that when the user changes, the offline submission causes the modification of other people's information. The solution is to strictly confirm that the submission information corresponds to the data of the database (e.g. password confirmation, etc.)

Cookies should be noticed when users use cookies to manipulate database changes

If the file is stored in UTF-8 format. The use of A,get way to submit, there are odd and even character problems, that is, the submission of even several characters no problem, the submission of odd characters the last character will appear garbled.

Format Number one: <%=formatnumber ("4102.225", 2)%> suitable for special use, sometimes without him.

Caesar cipher:
Encryption process:
Redaction: c=m+k (mod 26)
Decryption process:
Clear text: m=c-k (mod 26)
For study only, forbid reprint oh ~
Carriage return: Chr (<=>%0d%0a)
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.