Public Function StrLength(Str)
If IsNull(Str) or Str = "" Then
StrLength = 0
Exit Function
End If
Dim WINNT_CHINESE
WINNT_CHINESE=(Len("字符")=2)
If WINNT_CHINESE then
Dim l,t,c
Dim i
l=Len(Str)
t=l
For i=1 to l
c=asc(mid(Str,i,1))
If c<0 Then c=c+65536
If c>255 Then
t=t+1
End If
Next
StrLength=t
Else
StrLength=Len(Str)
End If
End Function
以上提供的是一个字定义的函数;
If StrLength(字符) <= 8 Then
Response.Write "X"
Else
Response.Write "Y"
End If