• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    asp自带的内存缓存 application
    函数getcache,会自动建立需要的缓存。
    复制代码 代码如下:

    Function getcache(funsname,isreset,isarr,timeinfo)
    ‘funsname — 需要缓存的内容,这里要输入一个function名
    ‘isreset –是否更新[值:0(根据时间或判断缓存为空时自动更新)、1(主动更新)]
    ‘ isarr —- 所缓存的内容是否为一个数据[0为字符串,1为数组]
    ‘ timeinfo —- 缓存更新时间,单位为秒,当值为0时,则只在缓存为空时,才更新
    dim domain = “cnzhaopin.com.cn”
    Dim temp_getconfig
    Dim re_getcache : re_getcache = False
    Dim temp_isarray_type : temp_isarray_type = False
    Dim Appfunsname : Appfunsname = Replace(Replace(Replace(funsname,”(”,”"),”)”,”"),”,”,”.”)
    If isarr = 1 Then temp_isarray_type = True
    If isreset = 1 Then re_getcache = True
    If isreset = 2 Then
    execute(”temp_getconfig=”funsname)
    getcache = temp_getconfig
    Exit Function
    End If
    If Application(domain”_”Appfunsname”_time”) = “” And timeinfo>0 Then re_getcache = True
    If Not re_getcache Then
    If temp_isarray_type Then
    If Not IsArray(Application(domain”_”Appfunsname)) Then re_getcache = True
    Else
    If Application(domain”_”Appfunsname) = “” Then re_getcache = True
    End If
    End If
    If Not re_getcache And timeinfo>0 Then
    If Int(DateDiff(”s”,Application(domain”_”Appfunsname”_time”),now()))>timeinfo Then re_getcache = True
    End If
    If re_getcache Then
    execute(”temp_getconfig=”funsname)
    Application.Lock
    Application(domain”_”Appfunsname) = temp_getconfig
    Application(domain”_”Appfunsname”_time”) = Now()
    Application.UnLock
    Else
    temp_getconfig=Application(domain”_”Appfunsname)
    End If
    getcache = temp_getconfig
    End Function


    使用时:

    复制代码 代码如下:

    Function output3
    output3=”"
    set newrs=conn.execute(”select TOP 60 companyname,comid,vipdata,ishot from company where isok=1 and vipqx>60 and vipqx300 and vip=1 and comid in (select comid from jobs where zt>1) order by newid()”)
    do while not newrs.eof
    output3=output3 “……….”
    newrs.movenext
    loop
    newrs.close
    set newrs=nothing
    End function
    response.write getcache(”output3″,0,0,3600)
    您可能感兴趣的文章:
    • ASP编程入门进阶(九):内置对象Application
    • javascript asp教程第十一课--Application 对象
    • asp清空application的方法
    • ASP javascript Application对象的Contents和StaticObjects做Cache的一些经验
    • ASP.NET内置对象之Application对象
    • asp.net Reporting Service在Web Application中的应用
    • php和asp利用Shell.Application来执行程序的代码
    • ASP.NET中Application和Cache的区别分析
    • asp.net错误处理Application_Error事件示例
    • ASP.NET 使用application与session对象写的简单聊天室程序
    • ASP基础入门第八篇(ASP内建对象Application和Session)
    上一篇:ASP读取XML实例 优酷专辑采集程序 雷锋版
    下一篇:Cookies 欺骗漏洞的防范方法(vbs+js 实现)
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    asp自带的内存缓存 application asp,自带,的,内存,缓存,application,