在网页调用 WINDOWS 控件两例(3)_Dreamweaver教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

setTimeout "DoRefresh",G_,"VBScript"
End If
End Sub

Sub DoRefresh()
C_=False
If D_ Then
RefreshMC
End If
End Sub

Sub DrawContacts
'********************************************************************
' Modified by JH
' DrawContacts:
'
On Error Resume Next
' new list of contacts to iterate thru
' ctr for list loop
Dim i
i = 0
' strings for output
Dim z, zz
z=""
zz=""
' for div visibility
Dim mU,mO,msgL,noneL,notOn,onli
mU="none"
mO="none"
msgL="none"
noneL="none"
notOn="block"
onli="block"
If E_ Then
mcClearCache
End If
' The heart of the matter
If MsgrObj.LocalState And 2 Then
'Online
If Not F_ Then
mcLoadCache
End If
If I_>0 Then
For i = 0 To ttl
select case H_(i).State
case 1
OffCtr = OffCtr 1
case else
OnCtr = OnCtr 1
end select
Next
ReDim OnA(OnCtr)
ReDim OffA(OffCtr)
OnCtr = 0
OffCtr = 0
' loop to get FriendlyNames of contacts and put them in their respective arrays
For i = 0 To ttl
If H_(i).State=1 then
Set OffA(OffCtr)=H_(i)
OffCtr = OffCtr 1
Else
Set OnA(OnCtr) = H_(i)
OnCtr = OnCtr 1
End If
Next
' sort online users
SortUsers2 0,OnCtr-1,True
For i = 0 to OnCtr-1
Dim onl
Dim h
onl=""
h=""
h = " href='VBScript:op(" & i & ")'"
onl = fixName(OnA(i).FriendlyName,17)
z = z & "<a" & h & " class=""color"">" & getStateImage(OnA(i).State) & "</a> " & "<a " & h & " title="""
z = z & "Send an instant message to " & onl & "."
z = z & """ class=""color"">" & K_ & onl
z = z & "</font></a><br>"
Next
' sort offline users
SortUsers2 0,OffCtr-1,False
For i = 0 to OffCtr-1
Dim ofn
ofn=""
ofn = fixName(OffA(i).FriendlyName,17)
zz = zz & getStateImage(OffA(i).State) & " "
zz = zz & K_ & ofn & "<br>"
Next
if OnCtr > 0 Then
mU="block"
mO="block"
document.all.mUser.innerHTML=z
document.all.mOff.innerHTML=zz
else
mU="block"
mO="block"
document.all.mUser.innerHTML="<font class=""small"">None</font>"
document.all.mOff.innerHTML=zz
end if
Else
noneL="block"
document.all.noneol.innerHTML=K_&"Your contact list is empty. <br><a href=vbscript:op(-2) class=""color"">Add contacts to your list.</a>"&"</font>"
end if
Else
If MsgrObj.LocalState=256 Or MsgrObj.LocalState=512 Then
msgL="block"
notOn="none"
onli="none"
B_ = True
document.all.statu.innerHTML = "<br> <img src='msn_icons/msn_ppl.gif' border='0' alt=''> <b>Connecting...</b></div>"
Else
msgL="block"
notOn="none"
onli="none"
if Not B_ Then
document.all.statu.innerHTML = L_
End If
End If
End If
document.all.Online.style.display=onli

来源:网上收集//所属分类:Dreamweaver教程/更新时间:2005-05-04
相关Dreamweaver教程