<%@ Language="VBScript" %> <% If ((Len(Trim(session("userid"))) = 0) or (Len(Trim(session("passwd"))) = 0)) Then response.Redirect "http://localhost/cdc/admin/admin_main.asp" End If %> <% dim objfso, objtxtfile, objtxttemp dim deletecheck, del Set objfso = CreateObject("Scripting.FileSystemObject") deletecheck = split(request.form("deletecheck"), ",") 'if not(isnull(deletecheck)) and deletecheck<>"" then ' dim arrdeletecheck ' arrdeletecheck=split(deletecheck,",") ' dim i, recfound ' dim userinfo, recarray ' recfound=0 Set tempfile = objfso.CreateTextFile("e:\project\cdc\datafiles\tempspeeches.txt") Set objTextFile = objfso.OpenTextFile("e:\project\cdc\datafiles\speeches.txt",1,true,0) Do While Not objTextFile.AtEndOfStream del = 0 userinfo=objTextFile.readline recarray=split(userinfo,"^") For i = 0 to UBound(deletecheck) if recarray(0) = deletecheck(i) then del = 1 end if next if del = 0 then tempfile.WriteLine userinfo end if Loop objTextFile.close set objTextFile = nothing tempfile.close set tempfile = nothing Set finalTextFile = objfso.CreateTextFile("e:\project\cdc\datafiles\speeches.txt") Set objTextFile = objfso.OpenTextFile("e:\project\cdc\datafiles\tempspeeches.txt",1,true,0) Do While Not objTextFile.AtEndOfStream finalTextFile.WriteLine objTextFile.readline Loop objTextFile.close set objTextFile = nothing finalTextFile.close set finalTextFile = nothing objfso.DeleteFile ("e:\project\cdc\datafiles\tempspeeches.txt") For i = 0 to UBound(deletecheck) objfso.DeleteFile ("e:\project\cdc\data\speeches\" & deletecheck(i) & ".html") objfso.DeleteFile ("e:\project\cdc\data\speeches\" & deletecheck(i) & ".txt") next Set objfso = nothing response.redirect "speeches_delete.asp" %>