Chat room using agent+asp technology to make voice chat room
--------------------the following for program content, sorted by the order in which the article appears
<!--define "Agentcontrol"-->
<object classid=clsid:d45fd31b-5c6e-11d1-9ec1-00c04fd7081f
codebase= #VERSION =2,0,0,0 id=agent>
</OBJECT>
<!--definition L&h TruVoice text-to-speech American 中文版-->
<object classid=clsid:b8f2846e-ce36-11d0-ac83-00c04fd97575
codebase= #VERSION =6,0,0,0 id=truvoice width= "height=" >
</OBJECT>
______________________________________________________________
Attempt to load from Microsoft Agent role directory
Set Loadrequestunc = Agent.Characters.Load ("Peedy", "Peedy.acs")
If loadrequestunc.status <> 0 Then
' If you fail, try downloading from Microsoft server
Set Loadrequesturl = Agent.Characters.Load ("Peedy", "HTTP://AGENT.MICROSOFT.COM/AGENT2/CHARS/PEEDY/PEEDY.ACF")
Else
' Now generates a Peedy instance
Set Peedy = agent.characters ("Peedy")
End If
_____________________________________________________________
<HTML>
<BODY>
<form method= "POST" action= "Default.asp" >
<p align= "center" >your Name please:
<input type= "text" name= "txtUserName" size= ">"
<input type= "Submit" value= "OK" name= "Btnok" ></p>
</FORM>
<p align= "center" ><a href= "download.htm" >click here to go download page.</a></p>
</BODY>
</HTML>
_______________________________________________________________________
<script Language=vbscript runat=server>
Sub Application_OnStart
Application ("message") = "" ' Speech content
Application ("expression") = "' Expression
Application ("sender") = "" ' Speaker ID
Application ("Globalid") =0 ' total number of speeches
End Sub
</SCRIPT>
_______________________________________________________________________
<%
Session ("username") = Server.HTMLEncode (Request.Form ("txtUserName"))
Session ("Personalid") =0
%>
<HTML>
<HEAD>
<title>welcome to my chatroom!</title>
</HEAD>
<frameset border=0 framespacing=0 cols= "98,*" frameborder=0>
<frame name= "Agent" src= "agent.asp" >
<frameset rows= "196,68,*" >
<frame name= "Display" src= "display.asp" >
<frame name= "Refresh" src= "refresh.asp" >
<frame name= "message" src= "message.asp" >
</frameset>
</frameset>
<frameset>
</frameset>
</HTML>
________________________________________________________________
<HTML>
<body bgcolor= "#006699" text= "#FFFFFF" >
<!--define "Agentcontrol"-->
<object classid=clsid:d45fd31b-5c6e-11d1-9ec1-00c04fd7081f
codebase= #VERSION =2,0,0,0 id=agent>
</OBJECT>
<!--definition L&h TruVoice text-to-speech American 中文版-->
<object classid=clsid:b8f2846e-ce36-11d0-ac83-00c04fd97575
codebase= #VERSION =6,0,0,0 id=truvoice width= "height=" >
</OBJECT>
<script language=vbscript>
Dim Peedy
Dim Loadrequestunc
Dim Loadrequesturl
Dim getshowanimation
Sub Window_onload
Loadcharacter
' Set the language code for the agent
Peedy.languageid = &h0409
' Let Peedy appear
Peedy.moveto window.event.screenx-100,window.event.screeny-100
Peedy.show
' Well, peedy can speak.
Peedy.speak "Welcome to my chatroom!"
Peedy.play "Greet"
End Sub
Sub Agent_requestcomplete (ByVal Request)
' If the request to load the ACF role from the Microsoft server ends
If Request = Loadrequesturl Then
' If the application download fails
If request.status = 1 Then
Msgbox "Unable to download peedy from the server, the server may be too busy." "
Exit Sub
' If successful
ElseIf request.status = 0 Then
' Produces an instance
Set Peedy = agent.characters ("Peedy")
' Prefetch peedy part of the animation effect
Set getshowanimation = Peedy.get ("state", "showing, speaking")
Peedy.get "Animation", "Blink,