Jump to content
Fórum Script Brasil
  • 0

Paginação Aspxtxt


thicomp
 Share

Question

Galera, alguém poderia dar uma ajuda neste código:

Ele tem que fazer uma paginação em um arquivo txt.

<%

Const forReading=1, forWriting=2, forAppending=8

Dim objteste, objtextstream, fso, objfile, objStream, x

Set fso = CreateObject("Scripting.FileSystemObject")

set objfile = fso.GetFile ("F:\2006.txt")

set objStream = objfile.OpenAsTextStream(forReading,false)

Texto = ObjStream.ReadAll

for x=0 to UBound(Texto)

cont = cont+1

arrImage(pag,cont) = Texto

if cont = 10 then

pag = pag+1

cont = 0

end if

next

Set Objfso = nothing

SetObjArq = nothing

MaxRecords = 10

MaxPages = Round (Texto/MaxRecords)

if request("pagi") = "" then

pagi=1

else

pagi=request("pagi")

end if

for j=1 to 10

response.write dados(x)

counter=1

Do while counter<=MaxPages

isStart = (((counter-1)*MaxRecords)+1)

if cint(counter) = cint(pagi) then

ref = ref & "Anterior |"

else

ref = ref &"<a href = teste16.asp?pagi="&counter&">Próxima</a>"

if counter < MaxPages then

ref = ref &"|"

end if

end if

counter = counter+1

loop

response.write ref

next

%>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      151k
    • Total Posts
      649.1k
×
×
  • Create New...