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

posted @ 2009-04-01 16:46  s80895304  阅读(399)  评论(0编辑  收藏  举报