Recommended: Function of using ASP for network printing %@ Language=VBScript % % Option Explicit Dim strSubmit 'The value used in Form to save the submission button Dim strPRinterPath 'The value of the network printer path in Form Dim strUsername 'The value of the user name in Form Dim strPassWord 'The value of the password in Form Dim strMessage 'The value of the printed content Dim objFS 'VBScript
I'm afraid few netizens who often surf the Internet have never been to the chat room to chat randomly. Just pay a little attention and you will find that most of these chat rooms are maintained using CGI programs or Applets developed in Java. Programmers who have developed such CGIs or Applets know that this kind of development is time-consuming and labor-intensive. So is there a simpler and labor-saving way to develop? The answer is yes.
There are many computer magazines that have been introduced to the introduction of Asp, and I will not go into details here.
1. Chat room planning:
1. Choice of the way to store conversation content: In what way should the content of instant conversation be stored on the server when displaying the content of the instant conversation on the client? There are two options for ASP, one is in text file mode, and the other is in database mode. However, the author feels that ASP's instructions for text file operations are far less than that provided by ADO (Active Data Object). Therefore, using ADO, ASP can flexibly operate the database, such as inserting, deleting, updating, querying, etc. The author chooses the access database to store the content of the conversation. The content of this database is only retained for one day (the length of time can be determined based on the actual situation of the LAN).
2. Chat room interface design: In order for customers to easily browse the content of the site and display the content of the chat room as much as possible, the author designed three frames in a homepage. The frame on the left shows the site's Index. The right frame is divided into two frames. The upper frame accounts for 70%, which is used to display the content of the current chat room; the lower frame accounts for 30%, which is used to provide a text input box and a button for user feedback.
3. Steps to enter the chat room: Like most chat rooms, the user should first provide a login interface, and the user enters his or her name or alias and a password he or she will give at will. If the username entered is the same as the username of the line, the user is prompted to reselect the username or re-enter the password to ensure that all usernames online are unique. After logging in successfully, enter the chat room, and the content display frame shows the welcome message of welcome joining. Users can enter the conversation content in the text input area.
2. Design process and development skills:
1. Design the ODBC system data source: As mentioned earlier, this development uses ASP to operate on ADO, so the data source must be set first. Double-click the ODBC icon in the control panel of the NT server, add the system DSN on the System DSN page, select Microsoft Access Driver, Data Source Name is 'fybchat', Database and select chat.mdb in the Chat directory. The database includes the following fields: name, content, password, chattime, chatdate, and store the name, conversation content, password, conversation time and conversation date respectively.
2. Login interface design: The login interface is an html page, containing some warning information and a Form. This Form has obtained the account and password, as shown below:
<form method=post action=receivedata.asp>Account:
<input type=text name=usname>Password:
<input type=password name=uspassword >
</center >
<input type=submit value= Enter>
<input type=reset value=Refill>
</center >
<input type=hidden name=content value= >
</form>
Inspire receivedata.asp by submit button. This ASP file is mainly used to ensure that no two users in the chat room have the same account. After the user submits the information, open chat.mdb to check whether the account already has. If there is one but the password is incorrect, remind the user to re-enter the password. If not, the user will successfully enter the chat room. The function of entering the chat room interface is completed by the following statement:
<FRAMESET ROWS=70%,30% >
<FRAME SRC=forum.asp NAME=main MARGINWIDTH=1
MARGINHEIGHT=1 Noresize >
<FRAME SRC=frft.asp?kname= <% =name%> NAME=footnotes
MARGINWIDTH=1 Noresize >
</FRAMESET >
Note that there is a trick here, using the parameter kname to hide the user's account in the customer's browser. In this way, the user submits his account every time he submits the conversation content.
3. Design of text input area: The text input area is generated by frft.asp. As mentioned above, every time the user submits the conversation content, he also submits his account. The user's action to submit the conversation content is to activate forum.asp. The purpose of Forum.asp is to refresh the content of the chat room. The content of Frft.asp is as follows
<!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN >
<html >
<head >
<meta http-equiv=Content-Type content=text/html; charset=gb_2312-80 >
<meta name=GENERATOR content=Microsoft FrontPage 2.0 >
<title >
</head >
<body >
<% kname=request.QueryString(kname)% >
<base target=main >
<form name=fm1 method=POST action=forum.asp>
<p align=center ><input type=text size=90 name=content > <p align=center ><input type=button name=B1 value= Submit/Refresh>
<input type=reset name=B2 value=rewrite>
<input type=hidden name=kname value=
Share: Create in-site search using ASP If you have a huge website and lots of content, it is often difficult for visitors to find what they need. At this time, you need a website search to help visitors find the information they are looking for faster! Now you can easily implement this function with asp, not to mention that there are so many sites that support asp now. You can use this search engine to search any of your homepage