asp stream 3004 生成文件问题

 On Error Resume Next
    Set oStream = Server.CreateObject(“ADODB.Stream”)
    With oStream
          .Type = 2
          .Mode = 3
       .open
       '.Charset = "utf-8"
       .Charset = "gb2312"
       .Position = oStream.size
       .WriteText = sContent
       .SaveToFile sFile, 2
       If Err.Number = 3004 Then
          Err.Clear
          fileName = Split(sFile, "/")(UBound(Split(sFile, "/")))
          If fileName = "" Then
              fileName = "index.htm.txt"
          End If
          thePath = Left(sFile,InStr(sFile,"/")-1) & "\" & fileName
          .SaveToFile thePath, 2
         End If
       .Close
    End With

你可能感兴趣的:(Stream)