asp读取txt问题.

来源:百度知道 编辑:UC知道 时间:2024/06/09 07:31:53
已经知道data.txt格式.<excel导出的>
0104 范妮 女 社区 69.0 76.00 72.50 是
0103 陈欣 女 社区 68.0 81.00 74.50 是
0110 邵琅 女 社区 64.0 79.33 71.67 是
请用asp帮我写出代码.

把每行的每个字段赋值.把第一个为编号.2.名字,三类别,四,五,六成绩,七合格否.
并根据名字或编号读取各行数据.<如果有几行就读取几行并分页>

<table border="1">
<tr>
<td>编号</td><td>名字</td><td>性别</td><td colspan="4">成绩</td><td>合格否</td>
</tr>
<%
page=request.QueryString("page")
if isnumeric(page) and page>0 then
pageno=cint(page)
else
pageno=1
end if
function getpage(pgsz,pgno)
dim fs,f,t,x,arr,skip
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fs=Server.CreateObject("Scripting.FileSystemObject")
set t=fs.OpenTextFile(server.MapPath("data.txt"),1,false)
do while not t.AtEndOfLine
t.skipline
loop
thecount=int(t.line/pgsz)
if cint(t.line/pgsz)>int(t.line/pgsz) then thecount=int(t.line/pgsz)+1
t.close
if pgno>thecount then pgno=thecount
skip=pgsz*(pgno-1)
set t=fs.OpenTextFile(server.MapPath("data.txt"),1,false)
for line=0 to ski