zoukankan      html  css  js  c++  java
  • asp 读取 另外一个带参数的asp文件(服务器不支持!放弃吧!骚年!)

    (服务器不支持!放弃吧!骚年!)

    主要作用是为了分离数据库,灵感是这样的:收到json影响,把asp里的数据,用一个页面输出,然后用另外一个页面读取,这样就不用有数据库位置的烦恼了

    代码 网上有很多,我贴上,作为记录

    <%
    Function GetBody(url)
    on error resume next
    Set Retrieval = CreateObject("Microsoft.XMLHTTP")
    With Retrieval
    .Open "Get", url, False, "", ""
    .Send
    GetBody = .ResponseBody
    End With
    Set Retrieval = Nothing
    End Function

    Function BytesToBstr(body,Cset)
    dim objstream
    set objstream = Server.CreateObject("adodb.stream")
    objstream.Type = 1
    objstream.Mode =3
    objstream.Open
    objstream.Write body
    objstream.Position = 0
    objstream.Type = 2
    objstream.Charset = Cset
    BytesToBstr = objstream.ReadText
    objstream.Close
    set objstream = nothing
    End Function

    Function getHTTPPage(Path)
    t = GetBody("http://localhost/"&Path)
    getHTTPPage=BytesToBstr(t,"GB2312")
    End function

    content = getHTTPPage("userComm.asp?do=k")
    response.Write(content)
    %>

  • 相关阅读:
    c# 代码控制文件夹权限时,只显示特殊权限的问题
    C#使用SQLite数据库遇到的问题(二)
    GC工作原理
    Thread
    -static
    String 练习题
    更进ATM
    继承 示例
    数组
    求奇偶数
  • 原文地址:https://www.cnblogs.com/pengchenggang/p/3668281.html
Copyright © 2011-2022 走看看