asp简单的ajax留言板

2019-09-14 07:31:18刘景俊


   Set mycom = new Common
   Set myacc = new AccHelper
   Set mymod = new MOD_Guest

  End Sub

  Private Sub Class_Terminate()

   Set mycom = Nothing
   Set myacc = Nothing
   Set mymod = Nothing

  End Sub

 End Class
%>

MOD_Guest.asp
<%
 '/// <summary>
 '/// 摘要说明。
 '/// </summary>
 Class MOD_Guest

  Public Id
  Public Content
  Public Re
  Public Addtime
  Public Ip

  Public Sub SetVar(vId,vContent,vRe,vAddtime,vIp)
   Id=vId
   Content=vContent
   Re=vContent
   Addtime=vAddtime
   Ip=vIp
  End Sub

 End Class
%>

Common.asp
<%
 '/// <summary>
 '/// 摘要说明
 '/// </summary>
 Class Common

  '/// <summary>
  '/// 获得信息
  '/// </summary>
  '/// <param name="Id">需要内容</param>
  '/// <param name="Id">替换关键字</param>
  '/// <returns>格式化后内容</returns>
  Public Function Format(str,arr)

   Dim r,i
   r = str   
   For i = 0 To UBound(arr)
    r = Replace(r,"{"&i&"}",arr(i))
   Next
   Format = r

  End Function

  Public Function Page(PageSize,CurrentPage,RecordCount,PageUrl)

   const C_RECORDCOUNT = "合计<STRONG><FONT color=""red"">{0}</FONT></STRONG>篇 |"
   const C_FIRSTPAGE1 = " <a href=""#"" onclick=""$('{0}&PageNo={1}')"">首页</a>"
   const C_FIRSTPAGE2 = " 首页"
   const C_PREVPAGE1 = " <a href=""#"" onclick=""$('{0}&PageNo={1}')"">上一页</a>"
   const C_PREVPAGE2 = " 上一页"
   const C_NEXTPAGE1 = " <a href=""#"" onclick=""$('{0}&PageNo={1}')"">下一页</a>"
   const C_NEXTPAGE2 = " 下一页"
   const C_LASTPAGE1 = " <a href=""#"" onclick=""$('{0}&PageNo={1}')"">尾页</a>"