CSDN博客

img yiruoyun

二进制连接函数VBSCRIPT

发表于2004/10/12 9:08:00  746人阅读

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

阅读全文
0 0

相关文章推荐

img
取 消
img