inFile)
'A file & path must be specified for the routine to work.
g_sTMPLFILE = server.mappath(inFile)
end property
private property get TemplateFile()
TemplateFile = g_sTMPLFILE
end property
public sub AddToken(inToken, inValue)
'This property allows us to set our tokens.
g_oDict.Add inToken, inValue
end sub
public sub GenerateHTML
'This is the main, and only public method of the class.
'This method will check whether we've specified a file or not.
'Check for the files existance if we have specified it.
'If the file exists we will open it and dumps it's contents into an array.
'The array is split on VbCrLf to make it more manageable.
if len(g_sTMPLFILE) > 0 then
dim l_oFSO, l_oFile, l_arrFile
set l_oFSO = createobject("Scripting.FileSystemObject")
if l_oFSO.FileExists(TemplateFile) then
g_bFILE = TRUE
set l_oFile = l_oFSO.OpenTextFile(g_sTMPLFILE)
l_arrFile = split(l_oFile.ReadAll, VbCrLf)
l_oFile.Close
set l_oFile = Nothing
end if
set l_oFSO = nothing
else
'Filename was never passed!
end if
'If we have a file, we will prase it line by line
&nb
'A file & path must be specified for the routine to work.
g_sTMPLFILE = server.mappath(inFile)
end property
private property get TemplateFile()
TemplateFile = g_sTMPLFILE
end property
public sub AddToken(inToken, inValue)
'This property allows us to set our tokens.
g_oDict.Add inToken, inValue
end sub
public sub GenerateHTML
'This is the main, and only public method of the class.
'This method will check whether we've specified a file or not.
'Check for the files existance if we have specified it.
'If the file exists we will open it and dumps it's contents into an array.
'The array is split on VbCrLf to make it more manageable.
if len(g_sTMPLFILE) > 0 then
dim l_oFSO, l_oFile, l_arrFile
set l_oFSO = createobject("Scripting.FileSystemObject")
if l_oFSO.FileExists(TemplateFile) then
g_bFILE = TRUE
set l_oFile = l_oFSO.OpenTextFile(g_sTMPLFILE)
l_arrFile = split(l_oFile.ReadAll, VbCrLf)
l_oFile.Close
set l_oFile = Nothing
end if
set l_oFSO = nothing
else
'Filename was never passed!
end if
'If we have a file, we will prase it line by line
&nb
| 对此文章发表了评论 |
