?? othertest.asp
字號:
<%
'設置文件的大小及MIME類型
Function SetForDisplay(field, contentType)
contentType = LCase(trim(contentType))
nFieldSize = field.ActualSize
bytes = field.GetChunk(nFieldSize)
Session("Bytes") = bytes
Session("Type") = contentType
End Function
%>
<%
sql = "select * from product where id=" & request("ID")
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.CursorLocation = 3
strConn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("new.mdb")
oRS.Open sql, strConn
SetForDisplay oRS("pic"),ors("name")
'常見文件的MIME類型
'GIF文件 "image/gif"
'BMP文件 "image/bmp"
'JPG文件 "image/jpeg"
'zip文件 "application/x-zip-compressed"
'DOC文件 "application/msword"
'文本文件 "text/plain"
'HTML文件 "text/html"
'一般文件 "application/octet-stream"
Set oRS.ActiveConnection = Nothing
%>
<%
'讀取數據庫中保存的內容
response.Expires = 0
response.Buffer = True
response.Clear
response.contentType = Session("Type")
response.BinaryWrite Session("Bytes")
Session("Type") = ""
Session("Bytes") = ""
response.End
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -