查看: 204|回复: 0

[文章教程] ASP获取数据流文件和文本的方法

[复制链接]
xuanxiao 发表于 2023-6-21 23:16:50 | 显示全部楼层 |阅读模式
  1. Dim bytecount,bytes
  2. Dim stream,strRet

  3. bytecount = Request.TotalBytes
  4. bytes = Request.BinaryRead(bytecount)

  5. Set stream = Server.CreateObject("ADODB.Stream")
  6.     stream.Type = 1 'adTypeBinary              
  7.     stream.Open()                                   
  8.         stream.Write(bytes)
  9.         stream.Position = 0                             
  10.         stream.Type = 2 'adTypeText               
  11.         stream.Charset = "utf-8"                     
  12.         strRet = stream.ReadText() 'here is your json as a string               
  13.     stream.Close()
  14. Set stream = nothing
  15. Call WriteToTextFile("ttasp.txt",strRet,"utf-8")  
复制代码


可以用于获取 POST 的原始主体等
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号