'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
%>