นี่คือการสอนโดยละเอียดเกี่ยวกับฟังก์ชั่นการปนเปื้อนที่ใช้กันทั่วไป ASP วิธีนี้ง่ายมาก เพื่อนที่สนใจมาเรียนรู้เกี่ยวกับมันกับบรรณาธิการ!
การคัดลอกรหัสมีดังนี้:
Rs.opensql, Conn, 1,1
ifrs.eofandrs.bofthen
Response.write "
-
อื่น
TotalPut = Rs.RecordCount
Mapperpage = 18
ifcurrentPage
CurrentPage = 1
endif
ถ้า (currentPage-1)*MaxPerpage> TotalPutThen
ถ้า (TotalPutModMaxPerPage) = 0 แล้ว
currentPage = totalput/maxperpage
อื่น
CurrentPage = TotalPut/MaxPerPage+1
endif
endif
ifcurrentPage = 1 จากนั้น
showpage1totalput, maxperpage, "infotype.asp? id =" & คำขอ ("id")
showcontent ()
showpagetotalput, maxperpage, "infotype.asp? id =" & คำขอ ("id")
อื่น
if (currentpage-1)*maxperpage
Rs.Move (CurrentPage-1)*MaxPerpage
Dimbookmark
บุ๊กมาร์ก = Rs.bookmark
showpage1totalput, maxperpage, "infotype.asp? id =" & คำขอ ("id")
การแสดงความคิดเห็น
showpagetotalput, maxperpage, "infotype.asp? id =" & คำขอ ("id")
อื่น
CurrentPage = 1
showpage1totalput, maxperpage, "infotype.asp? id =" & คำขอ ("id")
การแสดงความคิดเห็น
showpagetotalput, maxperpage, "infotype.asp? id =" & คำขอ ("id")
endif
endif
endif
-
subshowcontent ()
-
รหัสประจำตัว
เลือก
ชื่อเรื่องข้อมูล
วันที่อัปเดต
คลิก
เพิ่มผู้คน
แก้ไข
ลบ
สร้าง [ศูนย์]
i = 1
dowhilenotrs.eof
-
-
"target =" _ blank "> []
strCounts = Truelen (theTitle1)
Response.writeTheTitle1
-
DateTime = RS ("DateTime")
yname = ปี (DateTime)
mName = เดือน (DateTime)
iflen (mname)
dname = เดือน (DateTime)
iflen (dname)
folderName = yname & mname
-
/.htm"title="View หน้าสร้าง "target =" _ blank ">
"> แก้ไข
) "> ลบ
) "> สร้าง (',' ',' width = 0, ความสูง = 0 ')">)
i = i+1
ifi> maxperpagetheneexitdo
Rs.Movenext
วง
-
รหัสประจำตัว
เลือก
ชื่อเรื่องข้อมูล
วันที่อัปเดต
คลิก
เพิ่มผู้คน
แก้ไข
ลบ
สร้าง
enddub
-
FunctionShowPage (TotalNumber, MaxPerpage, ชื่อไฟล์)
-
หรอก
IftotalNumberModMaxPerPage = 0 แล้ว
n = totalNumber/maxperpage
อื่น
n = TotalNumber/MaxPerpage+1
endif
-
มี / รายการทั้งหมด
หน้าปัจจุบัน/
[หน้าแรก] [หน้าก่อนหน้า]
"> [home] & page ="> [หน้าก่อนหน้า]
[หน้าถัดไป] [หน้าสุดท้าย] & page = "> [หน้าถัดไป] & page ="> [หน้าสุดท้าย]
ไปที่:
onChange = "location.href = this.options [this.selectedIndex] .Value">
ifcurrentPage = Jthen
%> & page = "เลือก>
อื่น
-
& page = ">
endif
ต่อไป
-
endfunction
-
FunctionShowPage1 (TotalNumber, MaxPerpage, ชื่อไฟล์)
-
ความมืดมน
IftotalNumberModMaxPerPage = 0 แล้ว
B = TotalNumber/MaxPerpage
อื่น
B = TotalNumber/MaxPerpage+1
endif
-
มี / รายการทั้งหมด
หน้าปัจจุบัน/
dxystart = currentPage-5
ifdxystart
dxyend = currentPage+5
ifdxyend> bthendxyend = b
FORDXY = DXYSTARTTODXYEND
ifdxy = currentpagethen
Response.write "[" & "" & dxy & "" & "]" & "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" - = สีแดง>
อื่น
Response.write "[" & dxy & "" & "]" & "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" -
endif
ต่อไป
-
endfunction
-
Rs.close
setrs = ไม่มีอะไร
conn.close
setConn = ไม่มีอะไร
-
ข้างต้นเป็นบทช่วยสอนโดยละเอียดเกี่ยวกับฟังก์ชั่นการปนเปื้อนของ ASP ฉันเชื่อว่าคุณได้เรียนรู้เกี่ยวกับเรื่องนี้ สำหรับเนื้อหาที่เกี่ยวข้องเพิ่มเติมโปรดดำเนินการต่อเพื่อให้ความสนใจกับช่องเทคโนโลยี Wonew