Recommended: A practical asp pagination function Share an asp pagination function, it looks pretty good. The view is shown in the figure: You can modify it according to your own situation. Code: % 'Xie Liang repairs the paging program'call pagecontrol (total records, total page number, current page) Sub PageControl(iCount, pagecount, page) response.Write(style type=text/css/*Xie Liang pagination CSS*/div.pager{padding:10px
A model uses the asp file upload component to upload a file to the server to determine whether the file size exceeds the specified size. This example talks about the upload_5xsoft file upload component. File.filesize>10000000 can limit the number of k files to.
dim upload,file,formname,formpath,icount,filename,fileext
set upload=new upload_5xsoft 'Create upload object
Formpath=download/ 'Add (/) after the directory
if right(formpath,1)<>/ then formpath=formpath&/
for each formname in upload.file 'List all uploaded files
set file=upload.file(formname) 'Generate a file object
if file.filesize>1000000 then
message=1
else 'If filesize <20000 means there is file data
fileext=lcase(right(file.filename,4))
if fileext<>.exe and fileext<>.zip and fileext<>.rar and fileext<>.mxp then
message=2
else
randomize
rannum=int(90000*rnd)+10000
filename=formpath& lemongtree_ & year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&rannum&fileext
file.saveas server.mappath(filename) 'Save file
if fileext=.zip then
uploadtype = zip
elseif fileext=.rar then
uploadtype = rar
elseif fileext=.mxp then
uploadtype = mxp
elseif fileext=.exe then
uploadtype = exe
end if
uploadchar = filename
size = clng(file.filesize)/1000
message=3
end if
end if
next
%>
<% if message=1 then%>
<html>
<head>
<title>Size exceeds the standard</title>
<meta http-equiv=content-type content=text/html; charset=gb2312>
<script language=Web page effects>
function error_size()
{
alert (the file size exceeds 1000kb, please reselect.);
window.location=upload.asp;
}
</script>
</head>
<body bgcolor=#f2f2f2 leftmargin=0 topmargin=0 onload=error_size()>
</body>
</html>
<% elseif message=2 then%>
<html>
<head>
<title>Type mismatch</title>
<meta http-equiv=content-type content=text/html; charset=gb2312>
<script language=javascript>
function error_type()
{
alert (only upload zip/rar/exe/mxp files n Please select the correct file type!);
window.location=upload.asp;
}
</script>
</head>
<body bgcolor=#f2f2f2 leftmargin=0 topmargin=0 onload=error_type()>
</body>
</html>
<% elseif message=3 then%>
<html>
<head>
<title>Uploaded successfully</title>
<meta http-equiv=content-type content=text/html; charset=gb2312>
<script language=javascript>
function image_success()
{
alert(file upload successfully!);
parent.form1.url1.value=<%=uploadchar %>
parent.form1.size.value=<%=size%>k
window.location=upload.asp;
}
</script>
</head>
<body bgcolor=#f2f2f2 leftmargin=0 topmargin=0 onload=image_success()>
</body>
</html>
<% end if %>
<%
set file=nothing
set upload=nothing ''Delete this object
%>
Share: Features and functions of website production ASP language ASP (Abbreviation of Active Server Page) means the active server web page. ASP is an application developed by Microsoft to replace CGI scripting programs. It can interact with databases and other programs and is a simple and convenient programming tool. The format of ASP's web page file is .asp, and it is now commonly used in various dynamic websites. ASP is a server-side scripting environment that can be used