تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تطبيق صغير ، عمل البوم صور من خلال Asp
#1
كاتب الموضوع : AhmedEssawy


كود :
<CODE><%
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
qfolder = request.querystring("f")
if qfolder = "" then
folderspec = server.mappath(".")
Set filesys = CreateObject("Scripting.FileSystemObject")
Set demofolder = filesys.GetFolder(folderspec)
Set folcoll = demofolder.SubFolders
For Each subfol in folcoll
folsize = left((subfol.size/1000000), 3)
folist = folist & ""'>» " & subfol.Name & " <small> (" & folsize & " MB)</small>" & vbcrlf
folist = folist & "
"
Next
set filesys = nothing
Response.Write folist
else
filepath = server.mappath(".") & "\" & qfolder
captionfile = filepath & "\captions.txt"
Set filesys = CreateObject("Scripting.FileSystemObject")
Dim SomeArray()
'caption part
If filesys.FileExists(captionfile) then
set file = filesys.GetFile(captionfile)
Set TextStream = file.OpenAsTextStream(ForReading,TristateUseDefault)
captioncount = 0
Do While Not TextStream.AtEndOfStream
Line = TextStream.readline
ReDim Preserve SomeArray(captioncount)
SomeArray(captioncount) = line
'response.write captioncount & " " & somearray(captioncount) & "
"
captioncount = captioncount + 1
'Response.write Line
Loop
textStream.close
end if
'folder part
Set demofolder = filesys.GetFolder(filepath)
Set filecoll = demofolder.Files
filecount = 0
For Each file in filecoll
Ext = UCase(Right(File.Path, 3))
If Ext = "JPG" OR Ext = "GIF" Then
on error resume next
data = SomeArray(filecount)
on error goto 0
hrefpath = qfolder & "/" & file.name
imagepath = "" & data & "
20&%20hrefpath%20&%20"'><img src='" & hrefpath & "' border='1' title='" & data & "'>
"
filist = filist & imagepath & vbcrlf
filist = filist & "
"
filecount = filecount + 1
data = ""
end if
Next
set filesys = Nothing
filist = filist & "
<small><a href='http://www.allscoop.com/' target='_blank'>free image gallery</small>"
%>
<h3>«
<%=qfolder%></h3>
<%=filist%>

<% end if %>
}}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم