📄 example_database.asp
字号:
<!--#include file = "../CheckLogin.asp" -->
<!-- #include file="Upload.asp" -->
<!-- #include file="conn.asp" -->
<%
Server.ScriptTimeout = 900
Set RS = Server.CreateObject("ADODB.Recordset")
Set upload= New DoteyUpload
Dim binary, uploadID
Upload.Upload()
If upload.ErrMsg = "" then
For Each formName In upload.Files ''列出所有上传了的文件
Set file = upload.Files(formName) ''生成一个文件对象
Dim strSql
If Session("UserType") = "学生" Then
strSql = "UPDATE Student SET Pic = '"& Now() & file.FileName &"' WHERE ID = "& Session("ID")
ElseIf Session("UserType") = "教师" Then
strSql = "UPDATE Teacher SET Pic = '"& Now() &file.FileName &"' WHERE ID = "& Session("ID")
End If
binary = file.GetBinary()
conn.Execute(strSql)
Set file=nothing
Response.Redirect("../DetailTeacher.asp?ID="&Session("ID"))
Next
Else
Response.Write("上传过程中出现错误:<br>" & Upload.ErrMsg)
End If
Set upload=nothing
Conn.Close
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -