加入收藏 | 设为首页 | 会员中心 | 我要投稿 银川站长网 (https://www.0951zz.com/)- 云通信、基础存储、云上网络、机器学习、视觉智能!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

asp常用函数集合 很不错以后研究

发布时间:2023-07-24 13:02:51 所属栏目:Asp教程 来源:
导读:asp常用函数集合 很不错以后研究:<%function loadtempletfile(byval path) on error resume next dim objstream set objstream = server.createobject("adodb.stream") with objstream .type =

asp常用函数集合 很不错以后研究:

<%

function loadtempletfile(byval path)

    on error resume next

    dim objstream

    set objstream = server.createobject("adodb.stream")

    with objstream

        .type = 2

        .mode = 3

        .open

        .loadfromfile server.mappath(path)

        if err.number <> 0 then

            err.clear

             response.write("预加载的模板[" & path & "]不存在!")

            response.end()

        end if

        .charset = "" & chrset & ""

        .position = 2

            loadtempletfile = .readtext

        .close

    end with

    set objstream = nothing

end function

function movefiles(sFolder,dFolder)

    on error resume next

    dim fso

    set fso = server.createobject("scripting.filesystemobject")

    if fso.folderexists(server.mappath(sFolder)) and fso.folderexists(server.mappath(dFolder)) then

        fso.copyfolder server.mappath(sFolder),server.mappath(dFolder)

        movefiles = true

    else

        movefiles = false

        set fso = nothing

        call alertbox("系统没有找到指定的路径[" & sFolder & "]!",2)

    end if

    set fso = nothing

end function

function renamefolder(sFolder,dFolder)

    on error resume next

    dim fso

    set fso = server.createobject("scripting.filesystemobject")

    if fso.folderexists(server.mappath(sFolder)) then

        fso.movefolder server.mappath(sFolder),server.mappath(dFolder)

(编辑:银川站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章