-----------------Delete Files-------------------
<%
'' | E.g.
'| Call Generic_FileDeletion (File Path' 'Required')
'' | Call Generic_FileDeletion ("MyFile.txt")
'' | Call Generic_FileDeletion ("WIN95 / MyFile.txt")
'' |
'' | Please Remember to Specify A Path, Otherwise An Error Will Occur ...
Function generic_filedeeletion (Byval Strpath, Byval IntshowLabel)
'' Error Checking !!!! ...
If strpath = "" or isnull (strpath) THEN
Response.write ("Sorry Butt Is Required When Calling this function")
Response.end
END IF
'' Error Checking !!!! ...
If IntshowLabel = "" or isnull (intShowLabel) THEN
Response.write ("Sorry But The Paramter IntshowLabel b> is missing. Parameter is required")
Response.end
END IF
FileName = Server.mappath (StrPath)
Set fs = creteObject ("scripting.filesystemobject")
IF fs.fileexists (filename) THEN
fs.deletefile (filename)
IF IntshowLabel = 1 THEN
Response.write "File" & " (" & StrPath & ") b>" & "HAS Been Deleted with success"
END IF
Else
Response.write "No Path Was Found, OR File Does Not Exist To Delete ...
"
END IF
END FUNCTION
%>
--------------- Copy Document ------------------
<%
'' | E.G:
'' | Call Generic_FileCopy ("D: /xkudos/newsx_1997.mdb", "D: /xkudos/xkudos/xkudos/db/newsx_1997.mdb", TRUE)
Function generic_filecopy (Byval StrfileSource, Byval Stroverwrite)
'' -------------------------------- [Error Checking] ------------ ------------------- '' Error Checking !!!! ...
If strfilesource = "" or isnull (strfilesource) THEN
Response.write ("Sorry Butt Source Path Is Required When Calling this function")
Response.end
END IF
'' Error Checking !!!! ...
If StrfileDestination = "" or isnull (strfiledstination) THEN
Response.write ("Sorry Butt Destination Path Is Required When Calling this function")
Response.end
END IF
'' Error Checking !!!! ... [True - False]
If StroverWrite = "" or isnull (stroverwrite) THEN
Response.write ("Sorry Butt Destination Path Is Required When Calling this function")
Response.end
END IF
'' -------------------------------- [/ error checking] ----------- ---------------------
SET FSO = CreateObject ("scripting.filesystemObject")
If fso.fileexists (strfilesource) then
Fso.copyFile Strfilesource, StrfileDestination, StroverWrite
Else
Response.write ("The File Does Not Exist ...")
Response.end
END IF
SET FSO = Nothing
END FUNCTION
%>
----------------- Write the file ----------------
<%
'' | Example of Call:
'' | Call Generic_FileWriter ("MyFileName", "HTML", "The Content Goes Here ..."
Function generic_filewriter (strfilename, strfileextension, strfilecontent)
Set ofs = creteObject ("scripting.filesystemobject")
Set OTXS = OFS.OpenTextFile (Server.Mappath (StrfileName & "." & Strfileextension, 8, true)
OTXS.WRITELINE (STRFILECONTENT)
OTXS.Close
END FUNCTION
%> ----------------- Bole -----------------------
<%
'' | EXAMPLE:
'' | Call Fileferret (StrDirectory, DtstartingDate, DtendingDate, INTQUED)
'' | Normal USAge:
'| Call Fileferret ("/ Desktop / asp_odds / generic_funcs / test /", "19/02/2001 00:00:00", "20/02/2001 16:16:34", 0)
'' | WHEN USING ON Queued Directory:
'| Call Fileferret ("/ desktop / asp_odds / generic_funcs / test /", "19/02/2001 00:00:00", "20/02/2001 16:16:34", 1)
Function Fileferret (Byval DTStartingDate, ByVal Dtendingdate, Byval IntQued)
DIM INTBADCOUNTER '' IT WILL Count How Many Bad Emails There Are
DIM INTQUEDCOUNTER
INTBADCOUNTER = 0
INTQUEDCOUNTER = 0
'' ----------------------- [Start Error Checking] -------------------- -------
'' Checks if there is a (directory) Defined in the parameter
If strdirectory = "" or isnull (strdirectory) THEN
Response.write ("The Parameter for Directory Is Missing - IT IS A Required Parameter!")
Response.end
END IF
'' CHECKS IF THE (Starting Date) Parameter Is Missing
IF dtstartingdate = "" or isnull (dtstartingdate) THEN
Response.write ("The Starting Date Parameter Is Missing - IT IS A Required Parameter!")
Response.end
END IF
'' Checks if the (ending date) Parameter is Missing
If DtendingDate = "" or isnull (DtendingDate) THEN
Response.write ("The ending date parameter is missing - it is a required parameter!")
Response.end
END IF
'' Checks if the (intqueD) parameter is missingif intques = "" or isnull (intqued) THEN
Response.write ("The Intqued Parameter is Missing - IT IS A Required Parameter!")
Response.end
END IF
'' ----------------------- [End Error Checking] -------------------- -------
Set fs = creteObject ("scripting.filesystemobject")
Set f = fs.getfolder (server.mappath (strdirectory))
Set fc = f.files
%>