Directory Listesi (tr)

0
EXE RANK

Lєυтηαηт `

Fexe Kullanıcısı
Puanları 0
Çözümler 0
Katılım
11 Tem 2008
Mesajlar
943
Tepkime puanı
0
Puanları
0
Yaş
35
Lєυтηαηт `
FSO kullanılarak klasörünüzdeki dosyaları ve klasörleri boyutları ile listeleme yapan bir kod.

Bu kodları herhangi bir isimde .asp dosyası olarak kayıt edin ve çalıştırın.



************************************************** ****************



0 Then strTotalFolder = objFolder.SubFolders.Count

strTotalFile = objFolder.Files.Count

strPath = objFolder.ShortPath

strFolderSize = FileSize(objFolder.Size)

End If



If rsDirectory.Eof Then

ErrMsg "Kayıt Bulunmamaktadır!"

Else

With Response

.Write "<div align='center'>" & vbCrlf

.Write " " & vbCrlf

.Write " " & vbCrlf

.Write " " & vbCrlf

.Write " <b>#</b>" & vbCrlf

.Write " <b>" & vbCrlf

.Write " Ad</b>" & vbCrlf

.Write " " & vbCrlf

.Write " <b>Boyut</b>" & vbCrlf

.Write " " & vbCrlf

.Write " <b>Değiştirilme Tarihi</b>" & vbCrlf

.Write " " & vbCrlf

.Write " <a href='dlist.asp?Path=" & Left(Session("Path" ),InStrRev(Session("Path" ),"\" )-1) &"'>Üst Klasör</a>"

rsDirectory.Movefirst

Do While Not rsDirectory.Eof

If rsDirectory.Fields("Type" ).Value = 0 Then

strImage = ""

strName = "<a href='dlist.asp?Path=" & rsDirectory.Fields("Location" ).Value &"'><b>" & rsDirectory.Fields("Name" ).Value &"</b></a>"

Else

strImage = ""

strName = "<a target='_blank' href='" & rsDirectory.Fields("Location" ).Value &"'>" & rsDirectory.Fields("Name" ).Value &"</a>"

End If



.Write " " & vbCrlf

.Write " " & strImage &"" & vbCrlf

.Write " " & strName &"" & vbCrlf

.Write " " & vbCrlf

.Write " " & FileSize(rsDirectory.Fields("Size" ).Value) &"" & vbCrlf

.Write " " & vbCrlf

.Write " " & rsDirectory.Fields("DateLastModified" ).Value &"" & vbCrlf

.Write " " & vbCrlf

rsDirectory.Movenext

Loop

.Write " " & vbCrlf

.Write " " & vbCrlf

.Write " Bunulunduğunuz klasör <b>" & strPath &"</b> - Bu klasörde <b>" & strTotalFile &" dosya</b>, <b>" & strTotalFolder &" alt klasör</b> bulunmaktadır.<br>Bulunduğunuz klasörün boyutu <b>" & strFolderSize &"</b>" & vbCrlf

.Write " " & vbCrlf

.Write " " & vbCrlf

.Write "</div>" & vbCrlf

End With

End If

End Sub



Private Function FileSize(ItemSize)

If ItemSize >= 1073741824 Then

ItemSize = FormatNumber((ItemSize/1073741824),2) &" GB"

ElseIf ItemSize >= 1048576 Then

ItemSize = FormatNumber((ItemSize/1048576),2) &" MB"

ElseIf ItemSize >= 1024 Then

ItemSize = FormatNumber((ItemSize/1024),2) &" KB"

ElseIf ItemSize >= 0 Then

ItemSize = ItemSize &" byte"

Else

ItemSize = "0 byte"

End If



FileSize = ItemSize

End Function



Private Function EditUrl(Url)

If InStr(1,Url, "\\" ,1) 0 Then Url = Replace(Url,"\\" ,"\" )

EditUrl = Url

End Function



Public Sub ErrMsg(Msg)

Response.Write "<b>Hata :</b> " & Msg &"<br>" & vbCrlf

End Sub



End Class



Session("Path" ) = Replace(Request.QueryString("Path" ),"/" ,"\" )

If Session("Path" ) = "" Then Response.Redirect "?Path=.\"

If Session("Path" ) = "." Then Response.Redirect "?Path=..\"

If Session("Path" ) = ".." Then Session("Path" ) = Session("Path" ) &"\"



Set DList = New DL

DList.strLocation = Server.MapPath(Session("Path" ))

DList.AddItem

DList.DirectoryList

Set DList = Nothing



With Response

.Write "<br>" & vbCrlf

.Write "<div align='center'>"

.Write "<b>PsyChaos - Directory List v1.0b</b><br>Coded By <a href='mailto:semih@maxiasp.com'>PsyChaos</a>"

.Write "</div>"

End With

%>
 
Geri
Üst