青海bwinapp最新版建设、网络推广最好的公司--您身边的bwinapp最新版建设专家,马上拿起电话,联系我们:0971-8235355   
青海西宁bwinapp最新版建设、bwinapp最新版制作公司-西宁威势电子信息服务有限公司
 
西宁威势最新bwinapp最新版制做案例展示
Lastest Project
 
当前位置为:首页 >> ASP编程 >> 正文  
bwinapp最新版-bwin必赢地址-bwin必赢bwinapp最新版

文章来源: 西宁威势电子信息服务有限公司     发布时间:2010-5-8    浏览次数:3501   

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%
response.Charset="utf-8"

%>
<%
dim conn,db
dim connstr
db="Databases/111.mdb" '数据库文件位置
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else
conn.open connstr
end if
sub CloseConn()
 conn.close
 set conn=nothing
end sub
%>
<body>
<%
Const maxPagesize=3000     '设置分页字数
Function InsertPageBreak(strText)   '插入分页字符
Dim strPagebreak,s,ss
Dim i,IsCount,c,iCount,strTemp,Temp_String,Temp_Array
strPagebreak="[hiweb_break]"
s=strText
If Len(s)<maxPagesize Then
   InsertPageBreak=s
End If
s=Replace(s, strPagebreak, "")
s=Replace(s, "&nbsp;", "<&nbsp;>")
s=Replace(s, "&gt;", "<&gt;>")
s=Replace(s, "&lt;", "<&lt;>")
s=Replace(s, "&quot;", "<&quot;>")
s=Replace(s, "&#39;", "<&#39;>")
If s<>"" and maxPagesize<>0 and InStr(1,s,strPagebreak)=0 then
   IsCount=True
   Temp_String=""
   For i= 1 To Len(s)
    c=Mid(s,i,1)
    If c="<" Then
     IsCount=False
    ElseIf c=">" Then
     IsCount=True
    Else
     If IsCount=True Then
      If Abs(Asc(c))>255 Then
       iCount=iCount+2
      Else
       iCount=iCount+1
      End If
      If iCount>=maxPagesize And i<Len(s) Then
       strTemp=Left(s,i)
       If CheckPagination(strTemp,"table|a|b>|i>|strong|div|span") then
        Temp_String=Temp_String & Trim(CStr(i)) & ","
        iCount=0
       End If
      End If
     End If
    End If
   Next
   If Len(Temp_String)>1 Then Temp_String=Left(Temp_String,Len(Temp_String)-1)
   Temp_Array=Split(Temp_String,",")
   For i = UBound(Temp_Array) To LBound(Temp_Array) Step -1
    ss = Mid(s,Temp_Array(i)+1)
    If Len(ss) > 380 Then
     s=Left(s,Temp_Array(i)) & strPagebreak & ss
    Else
     s=Left(s,Temp_Array(i)) & ss
    End If
   Next
End If
s=Replace(s, "<&nbsp;>", "&nbsp;")
s=Replace(s, "<&gt;>", "&gt;")
s=Replace(s, "<&lt;>", "&lt;")
s=Replace(s, "<&quot;>", "&quot;")
s=Replace(s, "<&#39;>", "&#39;")
InsertPageBreak=s
End Function
Function CheckPagination(strTemp,strFind)   '检测有没包含table|a|b>|i>|strong|div|span等字符,避免分页时出错
Dim i,n,m_ingBeginNum,m_intEndNum
Dim m_strBegin,m_strEnd,FindArray
strTemp=LCase(strTemp)
strFind=LCase(strFind)
If strTemp<>"" and strFind<>"" then
   FindArray=split(strFind,"|")
   For i = 0 to Ubound(FindArray)
    m_strBegin="<"&FindArray(i)
    m_strEnd   ="</"&FindArray(i)
    n=0
    do while instr(n+1,strTemp,m_strBegin)<>0
     n=instr(n+1,strTemp,m_strBegin)
     m_ingBeginNum=m_ingBeginNum+1
    Loop
    n=0
    do while instr(n+1,strTemp,m_strEnd)<>0
     n=instr(n+1,strTemp,m_strEnd)
     m_intEndNum=m_intEndNum+1
    Loop
    If m_intEndNum=m_ingBeginNum then
     CheckPagination=True
    Else
     CheckPagination=False
     Exit Function
    End If
   Next
Else
   CheckPagination=False
End If
End Function
Function ContentPagination(hiwebstr)   '内容分页
Dim ContentLen, maxperpage, Paginate
Dim arrContent, strContent, i
Dim m_strFileUrl,m_strFileExt,ArticleID
ArticleID=Request.QueryString("ID")
strContent = InsertPageBreak(hiwebstr)
ContentLen = Len(strContent)
CurrentPage=Request.QueryString("Page")
If CurrentPage="" Then CurrentPage=0
If InStr(strContent, "[hiweb_break]") <= 0 Then
   ArticleContent = "<div id=""NewsContentLabel"" class=""NewsContent"">" & strContent & "</div><div id=""Message"" class=""Message""></div>"
Else
   arrContent = Split(strContent, "[hiweb_break]")
   Paginate = UBound(arrContent) + 1
   If CurrentPage = 0 Then
    CurrentPage = 1
   Else
    CurrentPage = CLng(CurrentPage)
   End If
   If CurrentPage < 1 Then CurrentPage = 1
   If CurrentPage > Paginate Then CurrentPage = Paginate
   strContent = "<div id=""NewsContentLabel"" class=""NewsContent"">"& arrContent(CurrentPage - 1)
   ArticleContent = ArticleContent & strContent&"</div><br/><br/><p><b>"
    m_strFileExt = ""
    m_strFileUrl = "?id=" & ArticleID & "&Page="
  ' End If
   If CurrentPage > 1 Then
     ArticleContent = ArticleContent & "<a href="""& m_strFileUrl & CurrentPage - 1 & m_strFileExt & """>上一页</a>&nbsp;&nbsp;"
   End If
   For i = 1 To Paginate
    If i = CurrentPage Then
     ArticleContent = ArticleContent & "<font color=""red"">[" & CStr(i) & "]</font>&nbsp;"
    Else
      ArticleContent = ArticleContent & "<a href="""& m_strFileUrl & i & m_strFileExt & """>[" & i & "]</a>&nbsp;"
     End If
   Next
   If CurrentPage < Paginate Then
    ArticleContent = ArticleContent & "&nbsp;<a href="""& m_strFileUrl & CurrentPage + 1 & m_strFileExt & """>下一页</a>"
   End If
   ArticleContent = ArticleContent & "</b></p>"
End If
Response.Write(ArticleContent)
End Function
%>
<%
set rs_news=server.createobject("adodb.recordset")
'sqltext4="select * from news where ArticleID=458 "
id=request("id")
sqltext4="select * from news where ArticleID="&id
rs_news.open sqltext4,conn,1,1

%>
<%
'response.Write(rs_news("Content"))
dim content
content=rs_news("Content")
'response.Write("yuanlai"&content)
%>
<%call ContentPagination(content)%>
<%
'response.Write( content)
%>
</body>
</html>


评论列表
正在加载评论……
  
评论   
呢  称:
验证码:
若看不清请点击更换!
内  容:
 
 
  在线洽谈咨询:
点击这里,在线洽谈   点击这里,在线洽谈   点击这里,在线洽谈
乘车路线    汇款方式   加盟合作  人才招聘
 
公司地址:青海省西宁市西关大街73号(三二四部队招行所四楼)     青ICP备13000578号-1 公安机关备案号:63010402000123    
QQ:147399120    mail:lostlove000@163.com    电话: 13897410341    邮编:810000
© Copyright( 2008-2009) QhWins.Com All Rights Reserved    版权所有:西宁威势电子信息服务有限公司 未经书面制授权,请勿随意转载!