📄 pictest.asp
字号:
<%
Function SetForDisplay(field, contentType)
contentType = 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"), "image/gif" '"image/gif" 为MIME类型
'常见文件的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
%>
<img src="theImg.asp">
<%response.write(Session("Type"))%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -