Step 1: Download the voice chat room server server, we want to use BChat Server in the BCHAT studio.
1. Enter http://bchat.yinsha.com/ page; 2. "Hot Headline" in the right side of the page "BCHAT launches 10 users free download version", what we need is it; 3. Click "BCHAT launched After 10 users free download version, I went to the free version of the download page; 4. Download "Windows Version" in the download page (other version I have not used it, I will use the Windows version); 5. Download the file It is bChat.zip to decompress him into a directory (in order to use it in the ASP program on the website, this directory should be a directory of your website, such as c: / inetpub / wwwroot /); 6. Press above After the operation, BCHAT Server is installed in a c: / inetpub / wwwroot / bchat / directory; . Copy all the files in the GB subdirectory to the current directory (the current directory is also a c: / inetpub / wwwroot / bchat / directory), which is installed with a voice chat room with a Simplified Chinese interface. (If you want to install your English interface, copy the files under the English subdirectory to the current directory; if you want to install the traditional Chinese interface, copy the files under the BIG5 subdirectory to the current directory.)
Step 2: Create a database. (Although the voice chat room can be used without building a database, we want the "ASP" voice chat room of the function, so we must use the database!)
1. Run Access to create an empty database, the database name is budd.mdb, the database is saved in the C: / INETPUB / WWWROOT / BCHAT / directory; 2. Select "Use Designer Creating Table"; 3. Add a field. Field Name BNAME, Data Type Select Text; 4. Add a field. Field Name BPORT, Data Type Select Number; 5. Close this (Designer Window). After the point is closed, you prompt you "Whether to save your changes", select "Yes Y", then let you enter the table name, enter Room, and determine. The Access will then prompt "No primary key has not been defined", do not use him, choose No n ". 6. Now the ROOM table is established, but there is no data in it, and we have a few data to him. 7. Double-click the ROOM table to add data; BNAME Enter "One Room" (this is the name of the room, you can write it), enter 5100 there (this is the port number running in BCHAT Server, you can also write. But this The port number cannot be a port that has been used in the system. If you are not familiar with the port, then you should write 5100, 5100 is generally idle); 8. Add a data; BNAME fill in "2 room", bPort fill in 5200; 9. Turn off Access.
Step 3: Write an ASP program. (I have written the program, you will copy the following code, then save the file into index.asp and save it to the c: / inetpub / wwwroot / bchat / directory.)
<% @Language = "vbscript" CODEPAGE = "936"%> <% Option Explicit%> <% '********************************** *********************************** The program name: ASP voice chat room 'program implementation: must rely on bchat Server, download address http://bchat.yinsha.com 'program: Madpolice' Completion time: 2003-2-23 17:36:00 'Description: 1. Test it on your own Windows 2000 Advanced Server,' No Ensure that it can operate normally in other environments. '2. I don't ask for any copyright, but please keep the name, don't you? '********************************************************** ************* DIM DB, CONNSTR, CONN, RS, SQL, Serveripdb = "bchat.mdb" connStr = "provider = microsoft.jet.Oledb.4.0; data source =" & Server. Mappath (DB) 'If your server uses an older version access driver, use the following connection method' connStr = "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & server.mappath (db) set conn = Server.CreateObject ( "ADODB.Connection") conn.Open connStrSet rs = Server.CreateObject ( "ADODB.RecordSet") serverIP = Request.ServerVariables ( "LOCAL_ADDR") sql = "SELECT * FROM room ORDER BY bPort"
Rs.open SQL, CONN, 1, 1IF RS.EOF THEN RS.CLOSE SET RS = Nothing conn.close set conn = nothing response.write "There is no record in the database!" response.endende
IF Application ("BCHAT_STATUS") <> "Running" the call startbchat () rs.movefirstnd IF%>