?? upfile2.asp
字號:
dds
<!-- #include file=../database.asp -->
<!-- #include file=../change.asp -->
<!-- #include file=upload.inc -->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from ourusers where username='supervisor'"
rs.open sql,conn,1,1
if not rs.eof then
if trim(rs("pass"))<>trim(session("pass")) then
response.write "<br>錯誤的密碼!"
'rs.close
'set rs=nothing%>
<script>top.location='../login.asp';</script>
<%
'response.write "rspass:"&rs("pass")
'response.write "sesseionpass:"&session("pass")
conn.close
set conn=nothing
response.end
else
rs.close
set rs=nothing
conn.close
set con=nothing
end if
else
response.write "錯誤:用戶不存在!"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
end if
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../html/style.CSS">
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor=ccbbaa>
<%
function lngConvert2(strTemp)
str1=leftb(strTemp,1)
str2=rightb(strTemp,1)
lngConvert2 = clng(ascb(str2) + ((ascb(str1) * 256)))
end function
function lngConvert(strTemp)
str1=leftb(strTemp,1)
str2=rightb(strTemp,1)
len1=ascb(str1)
len2=ascb(str2)
lngConvert = clng(ascb(str1) + ascb(str2) * 256)
end function
Dim FormData,FormSize
FormSize=Request.TotalBytes
FormData=Request.BinaryRead(FormSize)
response.write "大小"&FormSize&"<br>"
if FormSize>64535 then
response.write "文件太大,不能上傳!<br>"
response.end
end if
Set Fields = GetUpload(FormData)
If Fields("photo").FileName="" Then
response.write "沒選擇要上傳的文件!"
Response.end
end if
Set fs = CreateObject("Scripting.FileSystemObject")
dim tempstr
tempstr=server.mapPath(dirstring&"manage/")
response.write tempstr&"\test.htm"
Set outfile=fs.CreateTextFile(tempstr&"\test.htm",true)
Fields("photo").Value=bin2str(Fields("photo").Value)
'response.write Fields("photo").Value
outfile.Write Fields("photo").Value
outfile.close
set outfile=nothing
set fs=nothing
%>
上傳成功!!<a href=geturl.asp>馬上提取網址</a>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -