<%
Function ConvBytes(TBytes)
Dim inSize, isType
Const lnBYTE = 1
Const lnKILO = 1024 ' 2^10
Const lnMEGA = 1048576 ' 2^20
Const lnGIGA = 1073741824 ' 2^30
Const lnTERA = 1099511627776
If TBytes < 0 Then Exit Function
If TBytes < lnKILO Then
' ByteConversion
inSize = TBytes
isType = "bytes"
Else
If TBytes < lnMEGA Then
' KiloByte Conversion
inSize = (TBytes / lnKILO)
isType = "kb"
ElseIf TBytes < lnGIGA Then
' MegaByte Conversion
inSize = (TBytes / lnMEGA)
isType = "mb"
ElseIf TBytes < lnTERA Then
' GigaByte Conversion
inSize = (TBytes / lnGIGA)
isType = "gb"
Else
' TeraByte Conversion
inSize = (TBytes / lnTERA)
isType = "tb"
End If
End If
' format number to 2 decimal places
inSize = FormatNumber(inSize,2)
' Return the results
ConvBytes = inSize & " " & isType
End Function
Dim strPathInfo, strPhysicalPath
strPathInfo = Request.ServerVariables("SCRIPT_NAME")
strPhysicalPath = Server.MapPath(strPathInfo)
Dim objFSO, objFile, objFileItem, objFolder, objFolderContents
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPhysicalPath)
Set objFolder = objFile.ParentFolder
Set objFolderContents = objFolder.Files
Dim bgcolor, counter
Bgcolor = "#ffffff"
counter = 0
For each objFileItem In objFolderContents
If Right(objFileItem.Name,3) = "asp" Then
counter = counter + 1
end if
Next
if counter>40 then
s = counter/40
if (VarType(s)<>2) OR (VarType(s)<>3) then
s=s+1
end if
End if
if Request.QueryString("sy")="" then
sy=1
else
sy=Int(Request.QueryString("sy"))
end if
For each objFileItem In objFolderContents
If Right(objFileItem.Name,3) = "asp" Then
say=say+1
if (say<=sy*40) AND (say>sy*40-40) then
Response.Write "<a href=""" & objFileItem.Name & """>" & vbcrlf
Response.Write "<font color=#000000 style=""font-size: 8pt"" face=verdana><b>" & vbcrlf
Response.Write "" & objFileItem.Name & vbcrlf
Response.Write "</b></font></a><br>" & vbcrlf
end if
End If
next
%>
<br /><br />
<%for i=1 to s
if i<>sy then%>
<a href="liste.asp?sy=<%=i%>"><%=i%></a>
<%else Response.Write(i & " ")
end if
next%>