首页WEB开发ASP教程 → 编码解码相关函数汇总

编码解码相关函数汇总

日期:2007-3-27 08:19:09 出处:其他转载 作者:不详 人气:
上一页 [1] [2] [3] [4] [5] [6] 下一页

二进制文本的解码函数

将"CONTENT-TYPE","application/x-www-form-urlencoded"方式request近来的文本进行解码函数。
function CNencoder(xText)
 dim i,c,stemp,theLen
 set dr=CreateObject("Adodb.Stream")
 stemp=""
 dr.Mode=3
     dr.Type=1
     dr.Open
     dr.Write xText
     dr.Position=0
 
 theLen=dr.Size

 for i=1 to theLen
  if dr.EOS then Exit for
  c=ascB(dr.Read(1))
  If c > 127 Then
   if dr.EOS then Exit for
   stemp=stemp&Chr(AscW(ChrB(AscB(dr.Read(1)))&ChrB(c)))
   i=i+1
  else
   stemp=stemp&Chr(c)
   End If
 Next
 dr.close
 set dr=nothing
 CNencoder=stemp
end function

**********************************************************

上一页 [1] [2] [3] [4] [5] [6] 下一页

关于本站 | 帮 助 | 广告服务 | 版权声明 | 业务合作 | 捐助本站 | 软件发布 | 联系我们
77资源下载 www.77zy.com ©2007-2008 版权所有
备案编号:赣ICP备07002641号  QQ:674648476