ImagesIn_Count

Counts number of image files found in a folder
Images defined here are files with extension of .jpg, .png, .gif and .jpeg
Ignoring images with name Icon1.*

Function ImagesIn_Count(HTMLFolder)
 Retu       = 0
 ServerFolder   = Server.MapPath(HTMLFolder)
 set fo      = fso.GetFolder(ServerFolder)
 For each x in fo.files
  Extt     = UCase(Right(x.Name, 4))
  If Extt = ".JPG" Or Extt = "JPEG" or Extt = ".PNG" or Extt = ".GIF" Then
   If UCase(x.Name) = "ICON1.GIF" Or UCase(x.Name) = "ICON1.JPG" Or UCase(x.Name) = "ICON1.PNG" Then
   Else
    If x.name > "" Then Retu = Retu + 1
   End If
  End If
 Next
 ImagesIn_Count   = Retu
End Function

HTMLFolder

Views 227 Downloads 106

'FSO', 'Filesin_Count', 'ImagesIn', 'files', 'images', 'count', 'total'

ANmarAmdeen
333
Graphics Classic ASP
Revisions

v1.0

Needs