& ltp style = line-height: 150% & gt; -About ASP, there are many articles and chapters in Computer World News, so I won't repeat them here. The pen pal's work unit has a LAN woven by Windows NT4.0. IIS3.0 was installed on NT server, and several websites were established, one of which was called fyb.cam.gov.cn. This single website is not connected to the internet, but it also attracts many single workers because of the chat room. If your working environment is the same as ours, there is no harm in making a chat room in your own LAN.
& ltp style = line-height: 150% & gt; A, chat room planning:
-1. Selection of storage mode of conversation content: How should the conversation content be displayed on the client computer and stored in the server? ASP has two choices, one is text-based format, and the other is data-based format. However, I feel that ASP's instructions for text operation are far less than those provided by ADO(ActiveDataObject) for database operation. Using ADO and ASP can operate the database flexibly, which is better than inserting, deleting, updating and querying. The author chooses the Access database to store the contents of the conversation. The contents of this database can only be kept for one day (the length of time can be determined according to the actual situation of the LAN).
& ltp style = line-height: 150% & gt; 2. Interface design of chat room: In order to facilitate users to browse the website content and display the chat room content as much as possible, the author designed three frames in a main page. The box on the left shows the index of the site. The frame on the right is divided into two frames. The last frame accounts for 70%, which is used to show the content of the previous chat room; The next frame, accounting for 30%, is used to provide text input boxes and buttons for user feedback.
& ltp style = line-height: 150% & gt; -3. Steps to enter the chat room: Like many chat rooms, users should first be provided with a login interface, and users can enter their own names or aliases and their own passwords at will. If the user name entered is the same as the user name on the line, a new user name or password will be provided for the user to ensure that all user names on the line are unique. After successful login, enter the chat room, and the content display box shows the joy of "welcome to join". The user can input the conversation content in the text input area.
& ltp style = line-height: 150% & gt; Second, the design process and development skills:
-1, design the data source of ODBC system: As mentioned above, this development uses ASP to operate ADO, so it is necessary to set the data source first. Double-click the ODBC icon in the control panel of nt server, add the system DSN to the system DSN page, and select Microsoft Access Driver with the data source name' FY BChat'. Select chat.mdb recorded in the chat database. The database includes the following fields: name, content, password, chat time and chat date, and stores surname, chat content, password, chat time and chat date respectively.
& ltp style = line-height: 150% & gt; -2. Design of login interface: The login interface is an html page, including some warning messages and a form. This form can be used to obtain a user name and password, as shown below:
& ltp style = line-height: 150% & gt; & ltform method = " post " action = " receive data . ASP " & gt;
Last name:
Secret code:
& lt/center & gt; & ltbr & gt& ltbr & gt
& lt center & gt< input type = "submit" value = "enter" >
& ltinput type = " reset " value = " clear " > & lt; /center & gt;
& ltinput type = " hidden " name = " content " value = " " & gt;
& lt/form & gt;
-receivedata.asp excitedly raised and handed over the button. The ASP document owner wants to ensure that there are no two users with the same name in the chat room. After the user submits the message, the document opens chat.mdb to check whether the user name is available. If yes, but the password is incorrect, the user will be reminded to re-enter the password. If not, enter the chat room smoothly. The function of entering the chat room boundary is completed by the following statement:
& ltp style = line-height: 150% & gt; & ltFRAMESETROWS="70%,30% " & gt;
& ltFRAMESRC="forum.asp"NAME="main "
margin width = " 1 " margin height = " 1 " no resize & gt;
& ltFRAMESRC="frft.asp? kname=
& lt% = name % & gt" NAME = " footnote s " margin width = " 1 "
margin height = " 1 " no resize & gt。
& lt/FRAMESET & gt;
-Look, here's a clever trick. Through the parameter kname, the user's last name is hidden in the user's browser. In this way, every time the user mentions the conversation, he also mentions his last name.
& ltp style = line-height: 150% & gt; -3. Design of text input area: The text input area is produced in frft.asp. As mentioned above, every time the user mentions the conversation, he also mentions his last name. The user's action of using the dialogue content is to stimulate forum.asp. Forum.asp's function is to refresh the content of the chat room. The capacity of Frft.asp is as follows:
& ltp style = line-height: 150% & gt; & lt! DOCTYPE HTML public "
-//IETF//DTDHTML//EN " & gt;
& lthtml & gt
& lthead & gt
& ltmetahttp-equiv="Content-Type "
content = " text/html; charset=gb_23 12-80 " >
& ltmetaname= "Generator"
content="Microsoft FrontPage 2.0 " >
& lttitle & gt& lt/title & gt;
& lt/head & gt;
& ltbody & gt
& lt% kname = request. query string(" kname ")% & gt;
& ltbasetarget="main " >
& ltformname = " FM 1 " method = " POST " action = " forum . ASP " >
& ltpalign="center " >& ltinputtype="text"size="90 "
name = " content " & gt& lt/p & gt;
& ltpalign="center " >& ltinput type = " button " name = " b 1 "
Value= "submit/update" > < input type = "reset"
Name="B2" value= "rewrite" > & lt/p & gt;;
& ltinputtype="hidden"name="kname "
value = & lt% = kname % & gt& gt
& lt/form & gt;
& ltSCRIPTLANGUAGE = " VBScript " & gt
& lt! -
& ltp style = line-height: 150% & gt; Sub-timer 1 _ timer ()
If fm 1.content.value= ""then
fm 1.content.value= " "
Fm 1. Submit
other
If ... it will be over.
End joint
& ltp style = line-height: 150% & gt; sub b 1_onclick()
Fm 1. Submit
fm 1.content.value= " "
End joint
-& gt;
& lt/SCRIPT & gt;
& ltOBJECTID = " ietimer 1 " WIDTH = 39 HEIGHT = 39
CLASSID="CLSID:59CCB4A0-727D-
1 1CF-AC36-00aa 00 a47dd 2 "
code base = " http://208 . 208 . 208 . 20 1/ASP/ie timer . ocx " & gt;
& ltPARAM NAME = " _ ExtentX " VALUE = " 1005 " >
& ltparam name = " _ ExtentY " VALUE = " 1005 " >;
& ltPARAM NAME = " Interval " VALUE = " 7000 " >
& lt/OBJECT & gt;
& ltp style = line-height: 150% & gt; & lt/body & gt;
& lt/html & gt;
-At this time, there is another problem. Users must not stop to pay to see the latest chat room content, which obviously brings inconvenience to users. So, wouldn't it be better to control the content of the chat room with an ActiveX control of timer? So I chose Ietimer, for example
& ltp style = line-height: 150% & gt; Third, summary.
-From the above development process, we can know that using ASP program can flexibly transfer parameters and divide the process into several unique ASP programs, which is not very beneficial to the debugging of the program. The support of ActiveX control and the powerful operation ability of DAO make it possible to develop very powerful programs using ASP.