ASP生成静态错误~
高手进,帮我解决一下,在线等,偶是新手!请助,我下面这段代码生成静态页以后只能生成数据库里的第一个数据页。比如Prog_ID字段第一个是1,就只能生成1.html 我用htm.asp?id=4912也生成不了4912.html 生成出来的还是1.html是不是我的查询语句错了,那位高手帮帮,新手在线等,解决了送出XB
<----htm.asp-->
<%
szSQL = "SELECT Prog_ID FROM proginfo"
rsData.Open szSQL,con,1,3
if not rsData.eof then
%>
<%
Function GetPage(url)
dim Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False '', "", ""
.Send
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body)
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 = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
on error resume next
Url="http://*****/oemui/vod/show.asp?id="&rsData("Prog_ID")&""
''response.write "开始更新页面..."
wstr = GetPage(Url)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If (fs.FileExists(server.MapPath("../../oemui/html/")&"\"&rsData("Prog_ID")&".htm")) Then
fs.DeleteFile(server.MapPath("../../oemui/html/")&"\"&rsData("Prog_ID")&".htm")
End If
Set CrFi=fs.CreateTextFile(server.MapPath("../../oemui/html/")&"\"&rsData("Prog_ID")&".htm")
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
response.write "...<font color=red>更新完成!</font>"
%>
<%
rsData.Close
end if
%>