二进制连接函数VBSCRIPT

类别:数据库 点击:0 评论:0 推荐:

Public Function ConvertAsc(strIn)
 Dim i
 ConvertAsc = ""
 For i=1 to Len(strIn)
  Dim c: c = Asc(Mid(strIn, i, 1))
  If Abs(c)<128 Then
   ConvertAsc = ConvertAsc & ChrB(c)
  Else
   Dim h: h = Hex(c)
   ConvertAsc = ConvertAsc & ChrB(Int("&H" & Mid(h, 1, 2)))
   ConvertAsc = ConvertAsc & ChrB(Int("&H" & Mid(h, 3, 2)))
  End If
 Next
End Function

Dim a: a = ConvertAsc("hello world!")
Dim b: b = ConvertAsc("世界你好!")

Response.BinaryWrite a + b

本文地址:http://com.8s8s.com/it/it20300.htm