第二:newssort2 字段有可能不是数字类型,而是文本类型,要处理一下
第三:检查select语句,可能数据太多了,应该加以限制,比如: select top 100 *
Dim Url, Url1, Sort2
Sort2 = MyInt(rs("newssort2"))
i2 = MyInt(i2)
If i2 <1 Then i2 = 1
If Sort2 >0 Then
Url = WebPath &"html/news/newspage_" &Sort2 &"_" &Sort2 &"_" &i2 &".html"
Url1 = WebPath &"news.asp?id=" &Sort2 &"&n=" &Sort2 &"&page=" &i2 &"&time=" &Now
Call MakeIndex(Url, Url1) 'Sub
End If
Function MyInt(ByVal str)
If IsNumeric(Trim(str)) Then MyInt = Fix(CDbl(Trim(str))) Else MyInt = 0
End Function
Adodb.Stream 方式生成:
iCon 为生成的页面内容,fn为文件名
Dim obj
Set obj = Server.CreateObject("Adodb.Stream")
obj.Open
obj.Charset = "utf-8"
obj.Position = obj.Size
obj.WriteText = iCon
obj.SaveToFile Server.MapPath(fn), 2
obj.Close
Set obj = Nothing