一个手机新闻网站
源代码在线查看: config.asp
'========================================================================================
' 文 件 名: config.asp
' 版 本: WapForum教程--WAP新闻系统
' 说 明: 配置文件 | 请勿删除此说明内容,转载请注明出处。多谢合作!
' 文件日期: 2007-03-01
' 讨论网站: WapForum.cn
'========================================================================================
' Copyright (C) 2007 WapForum.cn. All rights reserved.
' 网 站: http://WapForum.cn
' 电子邮件: Service@WapForum.cn
' 联系QQ: 82890065
'========================================================================================
OPTION EXPLICIT
Response.Buffer = True
response.Expires= -1
Dim conn,connStr,mdbPath
'//打开数据库
Sub openConn()
mdbPath="data/wapnews.mdb"
'connstr="DBQ="+server.mappath(mdbPath)+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(mdbPath)
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
End Sub
'//关闭rs
Sub rsClose()
rs.close
set rs=nothing
End Sub
'//关闭conn
Sub connClose()
conn.Close
set conn=nothing
End Sub
'//全部关闭
Sub allClose()
rs.close
set rs=nothing
conn.Close
set conn=nothing
End Sub
'//过滤字符
Function replaceStr(str)
Dim myStr
myStr = str
replaceStr = ""
If IsNull(myStr) Then
Exit Function
End If
myStr = Replace(myStr, "'", "'") ''为单引号的HTM解码,为了避免在后面&被替换掉,所以在这里先把单引号还原
myStr = Replace(myStr, "$", "¥") '在WML里面“$”符号是表示变量,所以将其替换成¥
myStr = Replace(myStr, "&", "&")
myStr = Replace(myStr, " ", " ")
myStr = Replace(myStr, " myStr = Replace(myStr, ">", ">")
myStr = Replace(myStr, Chr(13), "") '将回车转换成换行
replaceStr = myStr
End Function
%>