'Close the stream and set it to nothing...
objStream.Close
Set objStream = Nothing
%>
前面我也说过,它也能操作二进制对象,其实只要修改一些参数就可以了,让我们来看一个例子:
!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library"
-->
%
'Create a stream object
Dim objStream
Set objStream = Server.CreateObject("ADODB.Stream")
'Open a GIF file
objStream.Type = adTypeBinary
objStream.Open
objStream.LoadFromFile "D:\Inetpub\wwwroot\images\banner\dimacbanner1.gif"
'Output the contents of the stream object
Response.ContentType = "image/gif"
Response.BinaryWrite objStream.Read
'Clean up....
objStream.Close
Set objStream = Nothing
%>