Main Software ActiveX ASP Source Downloads Android Contact
ASP

Here you can find some FREE usefull Classic ASP / VBScript code snippets, class modules, etc.
I use then myself on most of my projects, so you can rest assured they were optimized over time and are very reliable.
You can use them on your personal or commercial projects.
If you find them usefull to you, please make a donation (nomatter how small) to help me keep this content online for free.


Encode and Decode String File IO Misc
Base-64
HTML2Text
Recaptcha
SHA-1
Text2HTML
Escape
FileNameIn
FileSizeDesc
Format
RemoveTags
BinReadFile
CreateFolder
FileDateTime
FileExists
FileLen
FolderExists
GetFiles
GetFolders
ReadFile
IsValidEmail
SendCDOMail
ScanVar
Function GetFiles(String)String Retrive a local folder's file list.
Retuns a String with the file list. This list uses VB's Null char (Chr(0)) as the list separator.
Example
<%
Dim i, folder_contents, item_array
folder_contents = GetFiles("myfolder/mysubfolder") ' use relative or absolute paths
if folder_contents>"" then
   item_array = split(folder_contents, Chr(0))
   for i = 0 to ubound(item_array)
      response.write item_array(i) & "<br>"
   next
   else
   response.write "No files found here"
   end if
redim item_array(0): erase item_array
%>


Source Code
<%
Function GetFiles(foldername)
dim fso, folderpath, fld, itm
if mid(foldername,2,1)<>":" and left(foldername,2)<>"\\" then folderpath = Server.MapPath(foldername) else folderpath = foldername
set fso=server.createobject("scripting.filesystemobject")
If fso.FolderExists(folderpath) Then
   Set fld = fso.GetFolder(folderpath)
   For Each itm In fld.Files
      if GetFiles>"" then GetFiles = GetFiles & chr(0)
      GetFiles = GetFiles & itm.Name
      Next
   End If
set itm = Nothing: set fld = Nothing: set fso = Nothing
End Function
%>