'Reads the contents of the file .Function LoadFile (ByVal File) Dim objStream On Error Resume Next Set objStream = Server.CreateObject ( "ADODB.Stream") If Err.Number = -2147221005 Then Response.Write "
Unfortunately, your host does not support AdoDB.Stream, you can't use this program div> "Err.clear response.end end if with objstream .type = 2 .mode = 3 .open .loadFromFile Server.mappath (file) If Err.Number <> 0 Then Response.write "
File " & file & " font> can not be opened, please check if there is existence! Font> div> "Err.clear response.end end if .charset =" gb2312 ".position = 2 loadfile = .readtext .close end with set objstream = nothingend function
'Memory contents to a file Sub SaveToFile (ByVal strBody, ByVal File) Dim objStream On Error Resume Next Set objStream = Server.CreateObject ( "ADODB.Stream") If Err.Number = -2147221005 Then Response.Write "
Unfortunately, your host does not support AdoDB.Stream, you can't use this program div> "Err.clear response.end end if with objstream .type = 2 .open .charst =" gb2312 ".position = objstream .Size .writetext = strbody .savetofile server.mappath (file), 2 .close end with set objstream = nothingend subj