cpysadd.asp
<!--#include virtual="/inc/conn.asp" -->
<!--#include file="upfile.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%dim strysbh
dim strtpys
dim strsycl
dim strkgxh
dim stryszl
dim strbs
strysbh=request("txtysbh")
strtpys=session("address1")
strsycl=request("txtsycl")
strkgxh=request("txtkgxh")
stryszl=request("txtyszl")
strbs=request("txtbs")
set rs_cpys=server.createObject("adodb.recordset")
sqlstr="select * from cpys"
rs_cpys.open sqlstr,conn,1,3
rs_cpys.addnew
rs_cpys("ysbh")=strysbh
rs_cpys("tpys")=strtpys
rs_cpys("sycl")=strsycl
rs_cpys("kgxh")=strkgxh
rs_cpys("yszl")=stryszl
rs_cpys("bs")=strbs
rs_cpys.update
rs_cpys.close
conn.close
set rs_cpys=nothing
set conn=nothing
response.redirect"/admin/cpys.asp"
%>
</body>
</html>
upfile.asp
<!--#include virtual="/inc/upload_5xsoft.inc" -->
<%
dim upload,file,formName,formPath,iCount
set upload=new upload_5xSoft ''建立上传对象
response.write upload.Version&"<br><br>" ''显示上传类的版本
formPath="pictures/"
''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"
iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath(formPath&file.FileName) ''保存文件
session("address1")=formPath&File.FileName
iCount=iCount+1
end if
set file=nothing
next
set upload=nothing
%>