Function readFromFile(strFileName, strKey) dim objFileSys, objFile, arrLine Set objFileSys = Server.CreateObject("Scripting.FileSystemObject") if objFileSys.FileExists(strFileName) then Set objFile = objFileSys.OpenTextFile(strFileName, 1) do while not objFile.AtEndOfStream arrLine = split(objFile.ReadLine, "|") if isArray(arrLine) then if Ubound(arrLine) = 1 then if arrLine(0) = strKey then readFromFile = arrLine(1) objFile.close Set objFile = nothing Set objFileSys = nothing Exit Function end if end if end if loop end if readFromFile = null End Function function recordToFile(strFileName, strKey, strValue) dim objFileSys, objFile, arrLine, objDict, thing Set objFileSys = Server.CreateObject("Scripting.FileSystemObject") Set objDict = Server.CreateObject("Scripting.Dictionary") if objFileSys.FileExists(strFileName) then 'case where file already exists and presumably holds values Set objFile = objFileSys.OpenTextFile(strFileName, 1) do while not objFile.AtEndOfStream arrLine = split(objFile.ReadLine, "|") if isArray(arrLine) then if Ubound(arrLine) = 1 then objDict.Add arrLine(0), arrLine(1) end if end if loop objFile.close objFileSys.DeleteFile(strFileName) end if 'insert/update new item objDict.Item(strKey) = strValue Set objFile = objFileSys.OpenTextFile(strFileName, 2, true) for each thing in objDict objFile.writeLine thing & "|" & objDict.Item(thing) next objFile.Close Set objDict = Nothing Set objFile = Nothing Set objFileSys = Nothing End Function