Show <%
Dim myfso,myread
Set Myfso=createobject ("Scripting.FileSystemObject")
Set Myread=myfso.opentextfile (Server.MapPath ("./new_list.asp"), 1,0)
If Myread.atendofstream Then
Response.Write "No news currently added"
Response.End
Else
Dim Mytext,listarray
Mytext=myread.readall
Listarray=split (mytext, "|") ' ###### #把所有记录分割成一个数组a
Dim Recordcount,pagecount, PageSize, Pagenum
Recordcount=ubound (Listarray) ' ########### #记录条数
pagesize=2
Pagecount=recordcount/pagesize ' ###### #取得页面数
If InStr (1,pagecount, ".") =null or InStr (1,pagecount, ".") =0 Then
Pagenum=pagecount
Else
Pagenum=int (PageCount) +1
End If
Dim topage
Topage=cint (Request.QueryString ("ToPage")) ' ####### #取得要显示的页面
If Topage<=0 Then
Topage=1
End If
If Topage>pagenum Then
Topage=pagenum
End If
Dim i,j,n
B=listarray
For i=0 to Recordcount-1 ' ####### #把每一条记录组成一个数组
J=split (Listarray (i), ",")
If UBound (j) =6 Then
B (i) = "<span style= ' COLOR: #ffbd00; Font-size:7px ' ><li></span><span style= ' font-size:10pt ' ><a href= ' news_view.asp?id= ' & j (0) & "' Target=blank>" & J (1) & "(figure) </a> click:" & J (4) & "Time last Released:" &j (5) & "</SPAN&G t; "
Else
B (i) = "<span style= ' COLOR: #ffbd00; Font-size:7px ' ><li></span><span style= ' font-size:10pt ' ><a href= ' news_view.asp?id= ' & j (0) & "' Target=blank>" & J (1) & "</a> click:" & J (4) & "Time last Released:" &j (5) & "</span>"
End If
Next
' ####### #把记录反排序存储在新的数组实现按时间反排序
Dim c (100)
N=0
For I=recordcount to 0 step-1
C (n) =b (i)
N=n+1
Next
Dim CurrentRecord
currentrecord=pagesize* (topage-1) +1 ' ######## #显示每一页
For K=1 to PageSize
If Len (c (currentrecord)) =0 Then
Exit For
End If
Response.Write C (CurrentRecord) & "<br>"
Currentrecord=currentrecord+1
Next
Response.Write "<body bgcolor= #EDF0F5 topmargin=10 marginheight=5 leftmargin=4"
For M=1 to Pagenum
Response.Write "<span style=font-size:10pt><a href=news_list.asp?topage=" &m& ">" &m& " </a></span> "
Next
End If
%>