关于网站文件自动备份程序的一点思考(4)
If fso.FolderExists(bak_root & "\" & dates(i)) Then fso.DeleteFolder bak_root & "\" & dates(i)
Else
bak_date = bak_date & dates(i) & "|"
End If
Next
bak_date = bak_date & now_date
bak_set("bak_date") = bak_date
'4 update settings
Dim f
Set f = fso.OpenTextFile(Server.MapPath("bak_set.asp"),2,true)'2 写
Dim temp ,keys
temp = "<%" &vbCrlf & _
"Dim root_dir"&vbCrlf & _
"root_dir = """& root_dir &"""" &vbCrlf & _
"Dim bak_set" &vbCrlf & _
"Set bak_set = Server.createobject(""Scripting.Dictionary"")"&vbCrlf
keys = bak_set.Keys
For i = 0 to Ubound(keys)
temp = temp & "bak_set.Add """&keys(i)&""" , """ & bak_set(keys(i)) & """" & vbCrlf
Next
temp = temp & "%" & ">"
f.write temp
f.Close
Set fso = Nothing
Set f = Nothing
bak_start = true
End Function