当前位置:开发者网络 >> 技术教程 >> 数据库专栏 >> SQL Server >> 内容
精彩推荐
分类最新教程
分类热点教程
  
二进制连接函数VBSCRIPT
作者:未知
日期:2005-04-29
人气:
投稿:(转贴)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:

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
相关文章: