Some common questions about ASP (II.)

Source: Internet
Author: User
Tags chr
1. How to solve the problem of browsing ASP page, read only in local buffer!
Response.expire =0
2. The authentication number of the login is generated?
For:
respectively output hour (logtime), Minute (LogTime), Second (LogTime) (they do not need to add CStr),
CStr (Int (rnd*10000)) to see if there is a problem. In addition, obtaining a unique SN upon landing can
With SessionID & Now ()
3. The original code leaked?
Use WebClass to do, do not have to consider the original code leaks this problem.
4. Ask, who knows the Web page on the stock market timing refresh is how to achieve it?
A: You can use javaapplet communication functions to achieve.
Page refreshes can be made with <body onload= "settimeout (' location.reload () ', 5000);" >
5. What method does ASP use to display the picture in the database to the page?
Answer: response. Contenttype= "Image/jpeg" and then output the data with Response.BinaryWrite
Response. Contenttype= "Html/image"
6. How do I know the Memo field size, have friends say with Len (Recordset (MEM))?
A: If it is the database field name can be: Rs ("field name") (in your place should be RS ("ly"))
You can also do this:
If your RS is built with a SELECT statement, you can use numbers to refer to
Ssql= "Select id,ly from table name"
Set Rs=conn.execute (sSQL)
RS (0) means RS ("id"), and RS (1) is RS ("ly")
Q: Just want, like this forum display posts size method, such as (Bytes)
A: The ActualSize property of a Field object in ADO
7. How can I enter the contents of a text box that will wrap according to the line I entered?
Answer: Text area <textarea> words attribute wrap= "off"
Q: How the implementation will wrap according to the input text. Rather than you enter a large paragraph of text (there is a carriage return in the middle) but again from the record from the time there is no return, only in the place where the line should be changed into a space.
Answer: very simple!!
If the content fetched from the database is RS ("content")
<%
Dim scontent
Scontent=rs ("Content")
Scontent=replace (SCONTENT,CHR) & Chr (a), "<Br>"
Response.Write (scontent
%>
If you still want to save the space, you can also
Scontent=replace (Scontent, "", "&nbsp;")
8. How to use ASP technology, the records of the database are divided into multiple lines to write a text file?
Answer: Read the database with ADO, write the file with FileSystemObject
9. Can you write a short example of writing a file with FileSystemObject?
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.