📄 ppst_conn.asp
字号:
<!-- Powered By PaPasite -->
<%
Response.Buffer = True ' 打开页面缓冲
On Error Resume Next ' 打开错误处理
dim conn,connstr,db
db="PPst_Data.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
If Err.Number <> 0 Then
Err.Clear
Set conn = Nothing
response.Write "打开数据库时出现错误..." ' 错误处理
Response.Clear ' 清除缓冲区
Response.End
End If
Dim Action,ThisFilePath,ThisFileName,EveryPageNum,UserName,UserPwd,NewsURL,ClassURL
Action=Request("Action")
Sub T(Testname)
response.write Testname
response.end()
End Sub
ThisFilePath=Request.ServerVariables("PATH_INFO")
ThisFileName=lcase(Mid(ThisFilePath,InstrRev(ThisFilePath,"/")+1)) '获取本文件的名字
PPst_Path="PPst_UpLoadFile" '前后都不能带/
PPst_Path0=Replace(ThisFilePath,Mid(ThisFilePath,InstrRev(ThisFilePath,"/")+1),"")&PPst_Path '原始大小写保持不变
PPst_Path1=Replace(lcase(ThisFilePath),ThisFileName,"")&PPst_Path '全部小写
Function PPst_Save(Content)
PPst_Save=Replace(Replace(Content,PPst_Path0,PPst_Path1),PPst_Path1,PPst_Path)
End Function
Function PPst_Get(Content)
PPst_Get=Replace(Content,PPst_Path,PPst_Path1)
End Function
Function HtmlCode(HtmlStiring) '定义一个简单的HTML代码替换函数
HtmlStiring=Replace(HtmlStiring,"<","<")
HtmlStiring=Replace(HtmlStiring,">",">")
HtmlStiring=Replace(HtmlStiring,VBCrlf,"<br>")
HtmlStiring=Replace(HtmlStiring," "," ")
HtmlCode=HtmlStiring
End Function
Function TitleLeft(str,strlen) '函数,将汉字计算为两个字符
Dim l,t,c, i
l=len(str)
t=0
For i=1 to l
c=Abs(Asc(Mid(str,i,1)))
If c>255 then
t=t+2
Else
t=t+1
End if
If t>=strlen then
TitleLeft=left(str,i)&".."
Exit for
Else
TitleLeft=str&""
End If
Next
End Function
Session.TimeOut=20 '此处设定后台登陆有效时间
EveryPageNum=5 '此处定义列表每页显示多少条新闻
IsPinglun=1 '此处定义是否开启评论功能:1为开启,0为不开始,默认开启
UserName="admin" '此处定义后台管理员用户名
UserPwd="admin" '此处定义后台管理员密码
NewsURL="PPst_News.asp" '新闻功能文件:如果更改了文件名,请在此处设置
ClassURL="PPst_Class.asp" '新闻类别功能文件:如果更改了文件名,请在此处设置
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -