无为清净楼资源网 Design By www.qnjia.com

复制代码 代码如下:
<%
'判断是否要生成新的HTML
if Application("cache_asptohtml_date")="" then
Application.Lock
Application("cache_asptohtml_date")=now()
Application.Unlock
Call aspTohtml
Response.Redirect("index.html")
end if
if DateDiff("s", Application("cache_asptohtml_date"),Now)> 100 then '比较上次更新时间与当前时间相差多少秒
Application.Lock
Application("cache_asptohtml_date")=now()
Application.UnLock
Call aspTohtml
Response.Redirect("index.html")
Else
Response.Redirect("index.html")
End if

'获取当前目录!
function getpath
if Request.ServerVariables("SERVER_PORT")<>"80" then
UserUrl = "http://"&Request.ServerVariables("SERVER_NAME")& ":" & Request.ServerVariables("SERVER_PORT")& Request.ServerVariables("URL")
else
UserUrl = "http://"&Request.ServerVariables("SERVER_NAME")& Request.ServerVariables("URL")
end if
getpath=left(UserUrl,InstrRev(UserUrl,"/"))
end function

sub aspTohtml
'----------------------------------------------------------
'使用XMLHTTP生成静态首页的代码
'Curl 为你的首页地址,确保你的空间支持FSO
'-----------------------------------------------------------
dim read,Curl,content
Curl=getpath&"home.asp"
read=getHTTPPage(Curl)
if read<>"" then
content=read
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
Filen=Server.MapPath("index.html")
Set Site_Config=FSO.CreateTextFile(Filen,true, False)
Site_Config.Write content
Site_Config.Close
Set Fso = Nothing
end if
End sub
Function getHTTPPage(url)
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
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
%>

ASP定时生成静态页(HTML)2
复制代码 代码如下:
<%
set fs=server.createobject("scripting.filesystemobject")
file=server.mappath("time.txt")
set txt=fs.opentextfile(file,1,true)
if not txt.atendofstream then
times=txt.ReadLine
Else
response.write "<br /><!--有没有发现time.txt 开始生成!-->"
HtmlPage = "time.txt" '//生成的HTML文件名
Template = NOW()
Set FSO = Server.CreateObject ("Scripting.FileSystemObject")
Set FileOut = FSO.CreateTextFile(Server.MapPath (HtmlPage))
FileOut.WriteLine Template
FileOut.Close
Set FSO = Nothing
end If


If datediff("s",times,NOW()) > 3600 Then '//上次更新到现在的时间 大于 3600秒 则 更新
response.write "<br /><!--时间过了开始更新-->"

code = "这里是需要生成的html代码" '//如何得到代码的方式有很多

'//用FSO生成HTML页面
HtmlPage = "index.html" '//生成的HTML文件名
Template = code
Set FSO = Server.CreateObject ("Scripting.FileSystemObject")
Set FileOut = FSO.CreateTextFile(Server.MapPath (HtmlPage))
FileOut.WriteLine Template
FileOut.Close
Set FSO = Nothing

'//用FSO生成time.txt文件
HtmlPage = "time.txt" '//生成的HTML文件名
Template = NOW()
Set FSO = Server.CreateObject ("Scripting.FileSystemObject")
Set FileOut = FSO.CreateTextFile(Server.MapPath (HtmlPage))
FileOut.WriteLine Template
FileOut.Close
Set FSO = Nothing

Else

response.write "<br /><!-- 已经过去"&datediff("s",times,NOW())&"秒!-->"

End If
%>

标签:
定时生成,静态

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。

更新日志