⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.asp

📁 Ajax留言本源代码 网上找到的一个源码,希望做网站的能用上.
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
Public Database
Database="book.mdb"
Const SiteWidth="760"
Const PreName="ZhangKang"
Const Leo_User="Leo"
Const Leo_Pass="17show.net"

	On Error Resume Next
	dim Conn
	Set Conn= Server.CreateObject("ADODB.Connection")
	Conn.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " &Server.MapPath(Database)
	if err <> 0 then response.end

Sub SiteHead(HeadTitle,P)
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="author" content="Zero Crystal">
<meta name="keywords" content="0℃水晶,管理后台">
<meta name="description" content="0℃水晶,管理后台">
<title><%=HeadTitle%>‖一起秀网络,0℃水晶,后台管理</title>
<link rel="stylesheet" type="text/css" href="Style.css">
</head>
<body topmargin="0" leftmargin="0">
<%if Session(PreName&"_Leo_Login")="" and P>0 then response.redirect("Login.asp"):response.end%>
<table width="<%=SiteWidth%>" align="center" cellspacing="0" cellpadding="2">
    <tr><td class="trHead" colspan="7"> </td></tr>
    <tr align="center">
        <td><a href="Index.asp">后台说明</a></td>
        <td><a href="Channel.asp">分类频道</a></td>
        <td><a href="GuestBook.asp">留言频道</a></td>
	    <td><a href="DataBase.asp">数据管理</a></td>
	    <td><a href="Login.asp?Action=LoginOut">退出管理</a></td>
	    <td><a href="../" target="_blank.asp">访问首页</a></td>
	    <td><a href="http://17show.net/book/" target="_blank.asp">官方地址</a></td>
	</tr>
    <tr><td class="trHead" colspan="7"> </td></tr>
    <tr><td colspan="7">
<script type="text/javascript"><!--
google_ad_client = "pub-2276003706529608";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-10-23: 采集
google_ad_channel = "8028634382";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
    </td></tr>
</table>

<%
End Sub

Sub ShowExecuteTime()
	response.write(((timer-startTime)*1000)&"ms")
End sub

Sub SiteBottom
%>
<a href="http://17Show.Net" target="_blank">一起秀网络</a>‖执行时间:<%ShowExecuteTime%>&nbsp;&nbsp;&nbsp;&nbsp;
<b>
<%
End Sub

Function GetTime(time,parameter) 
    if not isnull(time) then
    dim d,m,y,h,mm,s,str,yy
    d=day(time):m=month(time):y=year(time):h=hour(time):mm=minute(time):s=second(time):yy=right(y,2)
    if d<10 then d="0"&d
    if m<10 then m="0"&m
    if len(h)=1 then h="0"&h
    if len(mm)=1 then mm="0"&mm
    if len(s)=1 then s="0"&s
    if parameter=1 then
       str=y&"-"&m&"-"&d&" "&h&":"&mm&":"&s
    elseif parameter=2 then
       str=y&"-"&m&"-"&d&" "&h&":"&mm
    elseif parameter=3 then
       str=y&"-"&m&"-"&d
    elseif parameter=4 then
       str=yy&"-"&m&"-"&d
    elseif parameter=5 then
       str=y&m&d&h&mm&s
    elseif parameter=6 then
       str=yy&m&d&h&mm&s
    elseif parameter=7 then
       str=y&"-"&m&"-"&d&"-"&h&"-"&mm&"-"&s
    elseif parameter=8 then
       str=y&"-"&m
    elseif parameter=9 then
       str=d&mm&s
    else
       str="错误参数"
    end if  
    else
       str="没有参数"
    end if	
    GetTime=str
End Function


Sub DividePage(LinkUrl,AllRecordCount,AllPageCount,PageShowNum,ShowNum,RecordUnit,CurrentPage,Width,TdWidth,TableClass,ForwardClass,TdClass,Align,LinkColor,UnLinkColor)
response.write "<table width="&Width&" cellspacing=""0"" cellpadding=""1"" class="&TableClass&" align="&Align&"><tr height=""20""><td class="&ForwardClass&" width=""50%"">&nbsp;共<b>"&AllRecordCount&"</b>"&RecordUnit&"&nbsp;&nbsp;第<b>"&CurrentPage&"</b>/<b>"&AllPageCount&"</b>页&nbsp;每页<b>"&ShowNum&"</b>"&RecordUnit&"</td><td class="&TdClass&" width="&TdWidth&">"
if CurrentPage/PageShowNum<=1 then 
     response.write "<font color="&UnLinkColor&" face=""webdings"">9</font>"
else
     response.write "<a href=""?"&LinkUrl&"Page="&CurrentPage-PageShowNum&"""><font color="&LinkColor&" face=""webdings"" title=""上一行"">9</font></a>"
end if
response.write "</td><td class="&TdClass&" width="&TdWidth&" align=""center"">"
if CurrentPage<2 then
response.write "<font color="&UnLinkColor&" face=""webdings"">7</font>"
else
response.write "<a href='?"&LinkUrl&"Page="&CurrentPage-1&"'><font color="&LinkColor&" face=""webdings"" title=""上一页"">7</font></a>"
end if
dim t,k
if CurrentPage mod PageShowNum=0 then
t=CurrentPage-PageShowNum+1
else
t=Int(CurrentPage/(PageShowNum))*PageShowNum+1
end if
if t<0 then t=1
for k=t to AllPageCount step 1
if CurrentPage=k then
response.write "<td class="&TdClass&" width="&TdWidth&" align=""center""><a href='?"&LinkUrl&"Page="&k&"'><u><b>"&k&"</b></u></a>"
else
response.write "<td class="&TdClass&" width="&TdWidth&" align=""center""><a href='?"&LinkUrl&"Page="&k&"'>"&k&"</a>"
end if
  if k mod PageShowNum=0 then exit for
next
response.write "<td class="&TdClass&" width="&TdWidth&" align=""center"">"
if CurrentPage/AllPageCount<1 then
response.write "<a href='?"&LinkUrl&"Page="&CurrentPage+1&"'><font color="&LinkColor&" face=""webdings"" title=""下一页"">8</font></a>"
else
response.write "<font color="&UnLinkColor&" face=""webdings"" title=""下页"">8</font>"
end if
response.write "</td><td class="&TdClass&" width="&TdWidth&" align=""center"">"
dim j,p
j=CurrentPage mod PageShowNum
if j=0 and CurrentPage-AllPageCount<0 then
     p=CurrentPage+PageShowNum
     if p>AllPageCount then p=AllPageCount
     response.write "<a href=""?"&LinkUrl&"Page="&p&"""><font color="&LinkColor&" face=""webdings"" title=""下一行"">:</font></a></td>"
   elseif j<>0 and (CurrentPage-j)+PageShowNum-AllPageCount<0 then
     p=CurrentPage+PageShowNum
     if p>AllPageCount then p=AllPageCount
     response.write "<a href=""?"&LinkUrl&"Page="&p&"""><font color="&LinkColor&" face=""webdings"" title=""下一行"">:</font></a></td>"
   else
     response.write "<font color="&UnLinkColor&" face=""webdings"">:</font></td>"
end if
response.write "</td><td></td></tr></table>"
End Sub

Function GetInfo(SqlTable,N,P,SplitStr,SplitStr1)
    dim rs,sql,i
    Set rs=Server.CreateObject("Adodb.RecordSet")
    sql="Select * from "&SqlTable&" where "&P&" order by Id"
    rs.open sql,conn,1,1
    if rs.bof and rs.eof then
       GetInfo="Error"
    else
       if InStr(N,",")<=0 then
          do while not rs.eof

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -