I write some of the functions that ASP often use

Source: Internet
Author: User
For the ASP language, to write a functional module as a class, that for efficiency, it is not necessarily a very advocated thing, but the modular to small to say, to write some functions as a function, that is, in the development of ASP, a lot of things, the following are some of the functions I often use, there are some I wrote, Some are found on the Internet, such as the CFS code, the network of CFS-encoded functions inside the variables are not declared, so after my page declared Option Explicit can not be used normally, very simple, I in the function of the variable declared on it.
It's just a part of it because I'm in the company and most of my information is on my home computer and I'm going to add it later ... If you have any good and the function, also welcome to communicate with me ...
' @ Conversion date is the day of the week function ' @idate is the standard date format ' @itype is 0 when the English day of the week, otherwise the Chinese function showweek (idate,itype) if Itype <> 0 Then Itype = 1 '// Prevent error Output Error Dim Inum,ndayinum = Weekday (Idate) If Itype = 0 Then select Case inum Case 1 nday = "Sunday" Case 2 Nday = "Monday" C ASE 3 Nday = "Tuesday" Case 4 nday = ' Wednesday ' case 5 nday = ' Thursday ' case 6 nday = ' Friday ' case 7 nday = ' Saturday ' End Selectelse Select Case Inum Case 1 nday = "Sunday" Case 2 Nday = "Monday" Case 3 Nday = "Tuesday" Case 4 Nday = "Wednesday" Case 5 NDA y = "Thursday" Case 6 nday = "Friday" Case 7 Nday = "Saturday" End SelectEnd if '//output Showweek = ndayend function '//**************** *********************************************
' @ Paging list function ' @ parameter description: Totalrecount: Total Records ' @page: Current page number, pagesize: Paging size, URL: page address function pagelist (totalrecount,page,pagesize, URL) Dim Startpage,endpage,ipage,totalpage '//Determine the number of parameters after the link file if InStr (1,url, "?") = 0 Then url = URL & "?" else url = URL & "&amp;" End If '//get total pages totalpage = totalrecount pagesizeif totalrecount mod pagesize <> 0 Then totalpage = Cint (totalrecountp agesize+1) StartPage = 1endPage = Totalpageif page > Then startpage = page-4if Totalpage < ten then endpage = Tot Alpageelse if page =< then EndPage = Ten Else EndPage = page + 4 if endpage > totalpage then endpage = Totalpage E nd ifend if%> Total:<%=totalrecount%>&nbsp;<%=pagesize%> page <%if page>1 then%><a href= "< %=url%>page=1 "><font face=" webdings ">9</font></a>&nbsp;<a href=" <%=url%> Page=<%=page-1%> "><font face=" Webdings ">7</font></a>&nbsp;<%end if%><% For ipage = StartPage to Endpageif ipage <> PagE then%> <a href= "" ><%=ipage%></a>&nbsp;<%else Response.Write i& "&nbsp;" End Ifnext%><%if (totalpage-page) >4 then%><a href= "<%=url%>page=<%=page+1%>" >< Font face= "Webdings" >8</font></a>&nbsp;<a href= "<%=url%>page=<%=totalPage%>" ><font face= "Webdings" >:</font></a>&nbsp;<%end if

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.