<% '********** 'Purpose: ' 1. To create a recordset using the FSO object and ADODB ' 1. Call the function when you're ready to open the recordset ' and output it onto the page. '********** Function kc_fsoFiles(theFolder, Exclude) Dim rsFSO, objFSO, objFolder, File Const adInteger = 3 Const adDate = 7 Const adVarChar = 200 'create an ADODB.Recordset and call it rsFSO Set rsFSO = Server.CreateObject("ADODB.Recordset") 'Open the FSO object Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 'go get the folder to output it's contents Set objFolder = objFSO.GetFolder(theFolder) 'Now get rid of the objFSO since we're done with it. Set objFSO = Nothing 'create the various rows of the recordset With rsFSO.Fields .Append "Name", adVarChar, 200 .Append "Type", adVarChar, 200 .Append "DateCreated", adDate .Append "DateLastAccessed", adDate .Append "DateLastModified", adDate .Append "Size", adInteger .Append "TotalFileCount", adInteger End With rsFSO.Open() 'Now let's find all the files in the folder For Each File In objFolder.Files 'hide any file that begins with the character to exclude If (Left(File.Name, 1)) <> Exclude Then rsFSO.AddNew rsFSO("Name") = File.Name rsFSO("Type") = File.Type rsFSO("DateCreated") = File.DateCreated rsFSO("DateLastAccessed") = File.DateLastAccessed rsFSO("DateLastModified") = File.DateLastModified rsFSO("Size") = File.Size rsFSO.Update End If Next 'And finally, let's declare how we want the files rsFSO.Sort = "DateCreated DESC, DateLastModified DESC " 'Now get out of the objFolder since we're done with it. Set objFolder = Nothing 'now make sure we are at the beginning of the recordset 'not necessarily needed, but let's do it just to be sure. rsFSO.MoveFirst() Set kc_fsoFiles = rsFSO End Function %>
About Synergy Unlimited Founders Services Events Media, Press Releases Contact Synergy
                                         Current Newsletter Archive of Past Newsletters
 

<% dim fs,fo,x set fs=Server.CreateObject("Scripting.FileSystemObject") if request("src")="D" and request("file")<>"" then response.write server.mappath("mailers\"&request("file")) set fo=fs.GetFile(server.mappath("mailers\"&request("file"))) fo.Delete(true) set fo=nothing end if %> <% set fs=Server.CreateObject("Scripting.FileSystemObject") Dim strFolder : strFolder = fs.GetFolder(Server.MapPath("sitecms\mailers\")) Dim rsFSO 'we will exclude all files beginning with a "_" Set rsFSO = kc_fsoFiles(strFolder, "_") %>
<% 'ouput the recordset on the page. i=1 While Not rsFSO.EOF Response.write("") i=i+1 rsFso.MoveNext() Wend rsFSO.close() Set rsFSO = Nothing %>
"&i&""&rsFSO("Name").Value&"

 

 

Affiliate Program
E-Newsletter
Products
Resources

 

 

TESTIMONIALS

 
 

"I SEE MYSELF IN A NEW LIGHT"

"I would recommend this workshop to others because you raised my awareness. I see myself in a new light. I was inspired…"

-Mary Schultz, Authenticity Inc.