易截截图软件、单文件、免安装、纯绿色、仅160KB

asp单页生成静态页

今天在网上找了好久关于ASP生成静态页的代码  最多的就是 FSO方法,模板方法,但不知道,我把代码拿来之后都不好用,就是提供下载的压缩包里面写好的我运行都是有错误。。
不过黄天不负有心人,我终于找到一个单页生成静态的方法,拿出来给大家分享
<!-- ======================== 生成静态方法 ====================== -->
<%
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://www.ent-wangchong.cn/index.asp"'要读取的页面地址
response.write "开始更新首页..."
wstr = GetPage(Url)
'response.write(wstr)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
'if not MyFile.FolderExists(server.MapPath("/html/")) then
'MyFile.CreateFolder(server.MapPath("/html/"))'
'end if
'要存放的页面地址
dizhi=server.MapPath("index.html")
If (fs.FileExists(dizhi)) Then
fs.DeleteFile(dizhi)
End If
Set CrFi=fs.CreateTextFile(dizhi)
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
response.write "更新完成!"
response.End()
%>
保存为asp就行,需要生成,执行一下这个文件!


相关文档:

ASP 内建对象速查卡

Application 对象
集合:
Contents
StaticObjects
方法:
Lock
Unlock
事件:
Application_OnEnd
Application_OnStart
ObjectContext 对象
方法:
SetAbort
SetComplete
事件:
OnTransactionAbort
OnTransactionCommit
Request 对象
集合:
ClientCertificate
Cookies
Form
Q ......

ASP UrlRewrite 使用参考文档


什么是UrlRewrite?
UrlRewrite 是 将静态页面转换为动态页面的一种技术. 例如.您网站页面是 http://www.yourdomain.com/news/docread.aspx?id=123 使用UrlRewrite转换后 可以 以 http://www.yourdomain.com/news/123.html 来访问.
UrlRewrite的用处: 满足搜索引擎的要求,Google可以抓取动态页面,但是google对动态页面 ......

ASP 内建对象

 
Active Server Pages 提供内建对象,这些对象使用户更容易收集通过浏览器请求发送的信息、响应浏览器以及存储用户信息(如用户首选项)。本文简要说明每一个对象。
Application 对象
可以使用 Application 对象使给定应用程序的所有用户共享信息。
Request 对象
可以使用 Request 对象访问任何用 HTTP 请求 ......

asp中控制时间显示/存储样式

FormatDateTime
返回表达式,此表达式已被格式化为日期或时间。
FormatDateTime(Date[, NamedFormat])
参数
Date
必选项。要被格式化的日期表达式。
NamedFormat
可选项。指示所使用的日期/时间格式的数值,如果省略,则使用 vbGeneralDate。
设置
NamedFormat 参数可以有以下值:
常数 值 描述
vbGeneralDate ......

asp中使用FCKeditor存取数据时出现乱码问题解决方法

     把FCKeditor嵌入到ASP当中用来存取数据和上传文件时出现了乱码问题,网上查了下才知道自己做ASP是gb2312的编码,而fckeditor默认的编码是utf-8,因此出现了乱码问题。
    网上找了一些一些解决办法,最终有用的拿来吧。在FCKeditor/editor/filemanager/connector/asp目录下有两个 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号