권장 : 실용적인 ASP 페이지 매김 기능 ASP Pagination 기능을 공유하면 꽤 좋아 보입니다. 보기는 그림에 나와 있습니다. 자신의 상황에 따라 수정할 수 있습니다. 코드 : % 'Xie Liang은 페이징 프로그램을 수리합니다. 페이징 프로그램'Call PageControl (총 레코드, 총 페이지 번호, 현재 페이지) 서브 PageControl (iCount, PageCount, Page) 응답 (스타일 유형 = Text/CSS/*Xie Liang Pagination CSS*/Div.Pager {패딩 : 10PX
모델은 ASP 파일 업로드 컴포넌트를 사용하여 파일 크기가 지정된 크기를 초과하는지 여부를 결정하기 위해 파일을 서버에 업로드합니다. 이 예제는 upload_5xsoft 파일 업로드 구성 요소에 대해 설명합니다. file.filesize> 100000000은 k 파일 수를 제한 할 수 있습니다.
DIM 업로드, 파일, FormName, FormPath, Icount, Filename, FileExt
UPLOAD 설정 = new Upload_5xSoft '업로드 개체 생성
formpath = download/ 'add (/) 디렉토리 후
오른쪽 인 경우 (formpath, 1) <>/ 그런 다음 formpath = formpath &/
업로드의 각 FormName에 대해 업로드 된 모든 파일을 나열하십시오
set file = ubload.file (formname) '파일 개체를 생성합니다
file.filesize> 10000000 인 경우
메시지 = 1
else 'if Filesize <20000이라면 파일 데이터가 있음을 의미합니다
fileExt = lcase (right (file.filename, 4))
if fileext <>. exe 및 fileExt <>. Zip and FileExt <>. rar 및 fileExt <>
메시지 = 2
또 다른
무작위 화
rannum = int (90000*rnd) +10000
filename = formpath & lemongtree_ & year (지금) & month (지금) & day (now) & hour (now) & minute (지금) & rannum & fileext
file.saveas serv.mappath (filename) '파일 저장
FileExt = .zip 인 경우
uploadtype = zip
elseif fileExt = .rar
uploadtype = rar
그렇다면 elseif fileExt = .mxp
uploadtype = mxp
그렇다면 elseif fileExt = .exe
uploadtype = exe
끝 If
uploadchar = filename
크기 = clng (file.filesize)/1000
메시지 = 3
끝 If
끝 If
다음
%>
<% message = 1이면%>
<html>
<헤드>
<title> 크기는 표준 </title>을 초과합니다
<meta http-equiv = content-type content = text/html; charset = gb2312>
<스크립트 언어 = 웹 페이지 효과>
함수 error_size ()
{
경고 (파일 크기는 1000KB를 초과하고 재 선정하십시오.);
Window.location = upload.asp;
}
</스크립트>
</head>
<body bgcolor =#f2f2f2 leftmargin = 0 topmargin = 0 onload = error_size ()>
</body>
</html>
<% elseif 메시지 = 2 그런 다음%>
<html>
<헤드>
<title> 유형 불일치 </title>
<meta http-equiv = content-type content = text/html; charset = gb2312>
<스크립트 언어 = javaScript>
함수 error_type ()
{
ALERT (ZIP/RAR/EXE/MXP 파일 만 업로드 만 업로드하십시오. n 올바른 파일 유형을 선택하십시오!);
Window.location = upload.asp;
}
</스크립트>
</head>
<body bgcolor =#f2f2f2 leftmargin = 0 topmargin = 0 onload = error_type ()>
</body>
</html>
<% elseif 메시지 = 3 그런 다음%>
<html>
<헤드>
<title> 성공적으로 업로드 </title>
<meta http-equiv = content-type content = text/html; charset = gb2312>
<스크립트 언어 = javaScript>
함수 image_success ()
{
경고 (파일 업로드가 성공적으로!);
parent.form1.url1.value = < %= uploadchar %>
parent.form1.size.value = <%= size%> k
Window.location = upload.asp;
}
</스크립트>
</head>
<body bgcolor =#f2f2f2 leftmargin = 0 topmargin = 0 onload = image_success ()>
</body>
</html>
< % 종료 if %>
<%
파일 = 아무것도 설정하지 않습니다
업로드를 설정하십시오 = 아무것도 ''이 개체를 삭제하십시오
%>
공유 : 웹 사이트 제작 ASP 언어의 기능 및 기능 ASP (활성 서버 페이지의 약어)는 활성 서버 웹 페이지를 의미합니다. ASP는 CGI 스크립팅 프로그램을 대체하기 위해 Microsoft가 개발 한 응용 프로그램입니다. 데이터베이스 및 기타 프로그램과 상호 작용할 수 있으며 간단하고 편리한 프로그래밍 도구입니다. ASP 웹 페이지 파일의 형식은 .asp이며 이제 다양한 동적 웹 사이트에서 일반적으로 사용됩니다. ASP는 사용할 수있는 서버 측 스크립팅 환경입니다.