Function f__getClientBrowser(s)
'取得浏览器类型
Dim re, aMatch, oMatche ' 建立变量。
Set re = New RegExp ' 建立正则表达式。
Dim i, sTemp
' 设置模式。
re.Pattern = "" & _
"(Netscape" & _
"|Opera" & _
"|NetCaptor" & _
"|MSN " & _
"|MSIE" & _
"|MyIE" & _
"|Mozilla" & _
")" & _
"[\s]{0,1}[0-9]{0,1}\.[0-9]{0,1}"
re.IgnoreCase = True ' 设置不区分大小写。
re.Global = True ' 设置全局可用性
Set aMatch = re.Execute(s)
For Each oMatche in aMatch ' 循环遍历Matches集合。
sTemp = oMatche.Value
If sTemp <> "" Then
f__getClientBrowser = sTemp
Exit Function
End If
Next
f__getClientBrowser = ""
End Function
Function f__getClientSystem(s)
'取得客户端操作系统
Dim re, aMatch, oMatche ' 建立变量。
Set re = New RegExp ' 建立正则表达式。
Dim i, sTemp
' 设置模式。
re.Pattern = "" & _
"(Windows" & _
"|Mac_" & _
"|Mac " & _
"|unix" & _
"|Linux" & _
"|SunOS" & _
"|BSD" & _
")" & _
"[^;\(\)]+"
re.IgnoreCase = True ' 设置不区分大小写。
re.Global = True ' 设置全局可用性
Set aMatch = re.Execute(s)
For Each oMatche in aMatch ' 循环遍历Matches集合。
sTemp = oMatche.Value
If sTemp <> "" Then
f__getClientSystem = sTemp
Exit Function
End If
Next
f__getClientSystem = ""
End Function