📄 asp实用函数库.htm
字号:
href="http://bbsj.com/"
style="COLOR: #003366">首页</A> >> <A
href="http://bbsj.com/AR_net/"
style="COLOR: #003366">网络编程</A> >> <A
href="http://bbsj.com/AR_net/net_ASP/"
style="COLOR: #003366">ASP技术</A></FONT></TD></TR>
<TR>
<TD align=middle>
<H4>ASP实用函数库</H4></TD></TR>
<TR>
<TD>
<TABLE align=center border=0 cellPadding=0
cellSpacing=0 width="98%">
<TBODY>
<TR>
<TD
style="FONT-SIZE: 14px"><%<BR>'判断文件名是否合法<BR>Function isFilename(aFilename)<BR> Dim sErrorStr,iNameLength,i<BR> isFilename=TRUE<BR> sErrorStr=Array("/","\",":","*","?","""","<",">","|")<BR> iNameLength=Len(aFilename)<BR> If iNameLength<1 Or iNameLength=null Then<BR> isFilename=FALSE<BR> Else<BR> For i=0 To 8<BR> If instr(aFilename,sErrorStr(i)) Then<BR> isFilename=FALSE <BR> End If<BR> Next<BR> End If<BR>End Function<BR><BR>'去掉字符串头尾的连续的回车和空格<BR>function trimVBcrlf(str)<BR> trimVBcrlf=rtrimVBcrlf(ltrimVBcrlf(str))<BR>end function<BR><BR>'去掉字符串开头的连续的回车和空格<BR>function ltrimVBcrlf(str)<BR> dim pos,isBlankChar<BR> pos=1<BR> isBlankChar=true<BR> while isBlankChar<BR> if mid(str,pos,1)=" " then<BR> pos=pos+1<BR> elseif mid(str,pos,2)=VBcrlf then<BR> pos=pos+2<BR> else<BR> isBlankChar=false<BR> end if<BR> wend<BR> ltrimVBcrlf=right(str,len(str)-pos+1)<BR>end function<BR><BR>'去掉字符串末尾的连续的回车和空格<BR>function rtrimVBcrlf(str)<BR> dim pos,isBlankChar<BR> pos=len(str)<BR> isBlankChar=true<BR> while isBlankChar and pos>=2<BR> if mid(str,pos,1)=" " then<BR> pos=pos-1<BR> elseif mid(str,pos-1,2)=VBcrlf then<BR> pos=pos-2<BR> else<BR> isBlankChar=false<BR> end if<BR> wend<BR> rtrimVBcrlf=rtrim(left(str,pos))<BR>end function<BR><BR>'判断Email是否有效,返回1表示正确<BR>Function isEmail(aEmail)<BR> Dim iLocat,v,iLength,i,checkletter<BR> If instr(aEmail,"@") = 0 Or instr(aEmail,".") = 0 Then<BR> isEmail=0<BR> EXIT FUNCTION<BR> End If<BR> iLocat=instr(aEmail,"@")<BR> If instr(iLocat,aEmail,".")=0 Or instr(iLocat+1,aEmail,"@")>0 Then<BR> isEmail=0<BR> EXIT FUNCTION<BR> End If<BR> If left(aEmail,1)="." Or right(aEmail,1)="." Or left(aEmail,1)="@" Or right(aEmail,1)="@" Then<BR> isEmail=0<BR> EXIT FUNCTION<BR> End If<BR> v="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-.@"<BR> iLength=len(aEmail)<BR> For i=1 To iLength<BR> checkletter=mid(aEmail,i,1)<BR> If instr(v,checkletter)=0 Then<BR> isEmail=0<BR> EXIT FUNCTION<BR> End If<BR> Next<BR> isEmail=1<BR>End Function<BR><BR>'测试用:显示服务器信息<BR>Sub showServer<BR> Dim name<BR> Response.write "<Table border=1 bordercolor=lightblue CELLSPACING=0>"<BR> for each name in request.servervariables<BR> Response.write "<tr>"<BR> Response.write "<td>"&name&"</td>"<BR> Response.write "<td>"&request.servervariables(name)&"<br></td>"<BR> Response.write "</tr>"<BR> next<BR> Response.write "</table>"<BR>End Sub<BR><BR>'测试用:显示Rs结果集以及字段名称<BR>Sub showRs(rs)<BR> Dim strTable,whatever<BR> Response.write "<center><table><tr>"<BR> for each whatever in rs.fields<BR> response.write "<td><b>" & whatever.name & "</B></TD>"<BR> next<BR> strTable = "</tr><tr><td>"&rs.GetString(,,"</td><td>","</tr><tr><td>"," ") &"</td></tr></table></center>"<BR> Response.Write(strTable)<BR>End Sub<BR><BR>'用HTML格式显示文本<BR>Function txt2Html(str)<BR> if isnull(str) then<BR> txt2Html=""<BR> exit Function<BR> end if<BR> str=Replace(str,chr(34),""")<BR> str=Replace(str,"<","<")<BR> str=Replace(str,">",">")<BR> str=Replace(str,chr(13)+chr(10),"<br>")<BR> str=Replace(str,chr(9)," ")<BR> str=Replace(str," "," ")<BR> txt2Html=str<BR>End Function<BR><BR>'测试用:显示调试错误信息<BR>Sub showError<BR> Dim sErrMsg<BR> sErrMsg=Err.Source&" "&Err.Description<BR> Response.write "<center>"&sErrMsg&"</center>"<BR> Err.clear<BR>End Sub<BR><BR>'显示文字计数器<BR>Sub showCounter<BR>Dim fs,outfile,filename,count<BR>filename=server.mappath("count.txt")<BR>Set fs = CreateObject("Scripting.FileSystemObject")<BR>If fs.fileExists(filename) Then<BR> Set outfile=fs.openTextFile(filename,1)<BR> count=outfile.readline<BR> count=count+1<BR> Response.write "<center>浏览人次:"&count&"<center>"<BR> outfile.close<BR> Set outfile=fs.CreateTextFile(filename)<BR> outfile.writeline(count)<BR>Else<BR> Set outfile=fs.openTextFile(filename,8,TRUE)<BR> count=0<BR> outfile.writeline(count)<BR>END IF<BR>outfile.close<BR>set fs=nothing<BR>End Sub<BR>%><BR><BR>Array() <BR> FUNCTION: 返回一个数组 <BR> SYNTAX: Array(list) <BR> ARGUMENTS: 字符,数字均可 <BR> EXAMPLE: <%<BR>Dim myArray()<BR>For i = 1 to 7<BR> Redim Preserve myArray(i)<BR> myArray(i) = WeekdayName(i)<BR>Next<BR>%> <BR> RESULT: 建立了一个包含7个元素的数组myArray<BR>myArray("Sunday","Monday", ... ... "Saturday") <BR> <BR>CInt() <BR> FUNCTION: 将一个表达式转化为数字类型 <BR> SYNTAX: CInt(expression) <BR> ARGUMENTS: 任何有效的字符均可 <BR> EXAMPLE: <%<BR>f = "234"<BR>response.write cINT(f) + 2<BR>%> <BR> RESULT: 236<BR>转化字符"234"为数字"234",如果字符串为空,则返回0值 <BR> <BR>CreateObject() <BR> FUNCTION: 建立和返回一个已注册的ACTIVEX组件的实例。 <BR> SYNTAX: CreateObject(objName) <BR> ARGUMENTS: objName 是任何一个有效、已注册的ACTIVEX组件的名字. <BR> EXAMPLE: <%<BR>Set con = Server.CreateObject("ADODB.Connection")<BR>%> <BR> RESULT: <BR> <BR>CStr() <BR> FUNCTION: 转化一个表达式为字符串. <BR> SYNTAX: CStr(expression) <BR> ARGUMENTS: expression 是任何有效的表达式。 <BR> EXAMPLE: <%<BR>s = 3 + 2<BR>response.write "The result is: " & cStr(s)<BR>%> <BR> RESULT: 转化数字“5”为字符“5”。 <BR> <BR>Date() <BR> FUNCTION: 返回当前系统日期. <BR> SYNTAX: Date() <BR> ARGUMENTS: None. <BR> EXAMPLE: <%=Date%> <BR> RESULT: 8/4/99 <BR> <BR>DateAdd() <BR> FUNCTION: 返回一个被改变了的日期。 <BR> SYNTAX: DateAdd(timeinterval,number,date) <BR> ARGUMENTS: timeinterval is the time interval to add; number is amount of <BR>time intervals to add; and date is the starting date. <BR> EXAMPLE: <%<BR>currentDate = #8/4/99#<BR>newDate = DateAdd("m",3,currentDate)<BR>response.write newDate<BR>%><BR><BR><%<BR>currentDate = #12:34:45 PM#<BR>newDate = DateAdd("h",3,currentDate)<BR>response.write newDate<BR>%> <BR> RESULT: 11/4/99<BR>3:34:45 PM<BR><BR>"m" = "month";<BR>"d" = "day";<BR><BR>If currentDate is in time format then,<BR>"h" = "hour"; <BR>"s" = "second"; <BR> <BR>DateDiff() <BR> FUNCTION: 返回两个日期之间的差值 。 <BR> SYNTAX: DateDiff(timeinterval,date1,date2 [, firstdayofweek ][, <BR>firstweekofyear]]) <BR> ARGUMENTS: timeinterval 表示相隔时间的类型,如“M“表示“月”。 <BR> EXAMPLE: <%<BR>fromDate = #8/4/99#<BR>toDate = #1/1/2000#<BR>response.write "There are " & _<BR> DateDiff("d",fromDate,toDate) & _<BR> " days to millenium from 8/4/99."<BR>%> <BR> RESULT: 从8/4/99 到2000年还有 150 天. <BR> <BR>Day() <BR> FUNCTION: 返回一个月的第几日 . <BR> SYNTAX: Day(date) <BR> ARGUMENTS: date 是任何有效的日期。 <BR> EXAMPLE: <%=Day(#8/4/99#)%> <BR> RESULT: 4 <BR> <BR>FormatCurrency() <BR> FUNCTION: 返回表达式,此表达式已被格式化为货币值 <BR> SYNTAX: FormatCurrency(Expression [, Digit ][, LeadingDigit ][, Paren ][, <BR>GroupDigit]]]]) <BR> ARGUMENTS: Digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是<BR>计算机的区域设置; LeadingDigit 三态常数,指示是否显示小数值小数点前面的<BR>零。 <BR> EXAMPLE: <%=FormatCurrency(34.3456)%> <BR> RESULT: $34.35 <BR> <BR>FormatDateTime() <BR> FUNCTION: 返回表达式,此表达式已被格式化为日期或时间 <BR> SYNTAX: FormatDateTime(Date, [, NamedFormat]) <BR> ARGUMENTS: NamedFormat 指示所使用的日期/时间格式的数值,如果省略,则使用 <BR>vbGeneralDate. <BR> EXAMPLE: <%=FormatDateTime("08/4/99", vbLongDate)%> <BR> RESULT: Wednesday, August 04, 1999 <BR> <BR>FormatNumber() <BR> FUNCTION: 返回表达式,此表达式已被格式化为数值. <BR> SYNTAX: FormatNumber(Expression [, Digit ][, LeadingDigit ][, Paren ][, <BR>GroupDigit]]]]) <BR> ARGUMENTS: Digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是<BR>计算机的区域设置。; LeadingDigit i指示小数点右侧显示位数的数值。默认值为 -<BR>1,指示使用的是计算机的区域设置。; Paren 指示小数点右侧显示位数的数值。默认<BR>值为 -1,指示使用的是计算机的区域设置。; GroupDigit i指示小数点右侧显示位数<BR>的数值。默认值为 -1,指示使用的是计算机的区域设置。. <BR> EXAMPLE: <%=FormatNumber(45.324567, 3)%> <BR> RESULT: 45.325 <BR> <BR>FormatPercent() <BR> FUNCTION: 返回表达式,此表达式已被格式化为尾随有 % 符号的百分比(乘以 <BR>100 )。 (%) <BR> SYNTAX: FormatPercent(Expression [, Digit ][, LeadingDigit ][, Paren ][, <BR>GroupDigit]]]]) <BR> ARGUMENTS: 同上. <BR> EXAMPLE: <%=FormatPercent(0.45267, 3)%> <BR> RESULT: 45.267% <BR> <BR>Hour() <BR> FUNCTION: 以24时返回小时数. <BR> SYNTAX: Hour(time) <BR> ARGUMENTS: <BR> EXAMPLE: <%=Hour(#4:45:34 PM#)%> <BR> RESULT: 16<BR>(Hour has been converted to 24-hour system) <BR> <BR>Instr() <BR> FUNCTION: 返回字符或字符串在另一个字符串中第一次出现的位置. <BR> SYNTAX: Instr([start, ] strToBeSearched, strSearchFor [, compare]) <BR> ARGUMENTS: Start为搜索的起始值,strToBeSearched接受搜索的字符串 <BR>strSearchFor要搜索的字符.compare比较方式(详细见ASP常数) <BR> EXAMPLE: <%<BR>strText = "This is a test!!"<BR>pos = Instr(strText, "a")<BR>response.write pos<BR>%> <BR> RESULT: 9 <BR> <BR>InstrRev() <BR> FUNCTION: 同上,只是从字符串的最后一个搜索起 <BR> SYNTAX: InstrRev([start, ] strToBeSearched, strSearchFor [, compare]) <BR> ARGUMENTS: 同上. <BR> EXAMPLE: <%<BR>strText = "This is a test!!"<BR>pos = InstrRev(strText, "s")<BR>response.write pos<BR>%> <BR> RESULT: 13<BR><BR> <BR>Int() <BR> FUNCTION: 返回数值类型,不四舍五入,注意取值是不大于它的整数。 <BR> SYNTAX: Int(number) <BR> ARGUMENTS: <BR> EXAMPLE: <%=INT(32.89)%> <%=int(-3.33)%><BR> RESULT: 32 -4<BR> <BR>IsArray() <BR> FUNCTION: 判断一对象是否为数组,返回布尔值 . <BR> SYNTAX: IsArray(name) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>strTest = "Test!"<BR>response.write IsArray(strTest)<BR>%> <BR> RESULT: False <BR> <BR>IsDate() <BR> FUNCTION: 判断一对象是否为日期,返回布尔值 <BR> SYNTAX: IsDate(expression) <BR> ARGUMENTS: expression is any valid expression. <BR> EXAMPLE: <%<BR>strTest = "8/4/99"<BR>response.write IsDate(strTest)<BR>%> <BR> RESULT: True <BR> <BR>IsEmpty() <BR> FUNCTION: 判断一对象是否初始化,返回布尔值. <BR> SYNTAX: IsEmpty(expression) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>Dim i<BR>response.write IsEmpty(i)<BR>%> <BR> RESULT: True <BR> <BR>IsNull() <BR> FUNCTION: 判断一对象是否为空,返回布尔值. <BR> SYNTAX: IsNull(expression) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>Dim i<BR>response.write IsNull(i)<BR>%> <BR> RESULT: False <BR> <BR>IsNumeric() <BR> FUNCTION: 判断一对象是否为数字,返回布尔值. <BR> SYNTAX: IsNumeric(expression) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>i = "345"<BR>response.write IsNumeric(i)<BR>%> <BR> RESULT: True<BR>就算数字加了引号,ASP还是认为它是数字。 <BR> <BR>IsObject() <BR> FUNCTION: 判断一对象是否为对象,返回布尔值. <BR> SYNTAX: IsObject(expression) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>Set con = Server.CreateObject("ADODB.Connection")<BR>response.write IsObject(con)<BR>%> <BR> RESULT: True <BR> <BR>LBound() <BR> FUNCTION: 返回指定数组维的最小可用下标. <BR> SYNTAX: Lbound(arrayname [, dimension]) <BR> ARGUMENTS: ; dimension 指明要返回哪一维下界的整数。使用 1 表示第一维,2 <BR>表示第二维,以此类推。如果省略 dimension 参数,默认值为 1. <BR> EXAMPLE: <%<BR>i = Array("Monday","Tuesday","Wednesday")<BR>response.write LBound(i)<BR>%> <BR> RESULT: 0 <BR> <BR>LCase() <BR> FUNCTION: 返回字符串的小写形式 <BR> SYNTAX: Lcase(string) <BR> ARGUMENTS: string is any valid string expression. <BR> EXAMPLE: <%<BR>strTest = "This is a test!"<BR>response.write LCase(strTest)<BR>%> <BR> RESULT: this is a test! <BR> <BR>Left() <BR> FUNCTION: 返回字符串左边第length个字符以前的字符(含第length个字符). <BR> SYNTAX: Left(string, length) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>strTest = "This is a test!"<BR>response.write Left(strTest, 3)<BR>%> <BR> RESULT: Thi <BR> <BR>Len() <BR> FUNCTION: 返回字符串的长度. <BR> SYNTAX: Len(string | varName) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>strTest = "This is a test!"<BR>response.write Len(strTest)<BR>%> <BR> RESULT: 15 <BR> <BR>LTrim() <BR> FUNCTION: 去掉字符串左边的空格. <BR> SYNTAX: LTrim(string) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>strTest = " This is a test!"<BR>response.write LTrim(strTest)<BR>%> <BR> RESULT: This is a test! <BR> <BR>Mid() <BR> FUNCTION: 返回特定长度的字符串(从start开始,长度为length). <BR> SYNTAX: Mid(string, start [, length]) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>strTest = "This is a test! Today is Monday."<BR>response.write Mid(strTest, 17, 5)<BR>%> <BR> RESULT: Today <BR> <BR>Minute() <BR> FUNCTION: 返回时间的分钏. <BR> SYNTAX: Minute(time) <BR> ARGUMENTS: <BR> EXAMPLE: <%=Minute(#12:45:32 PM#)%> <BR> RESULT: 45 <BR> <BR>Month() <BR> FUNCTION: 返回日期. <BR> SYNTAX: Month(date) <BR> ARGUMENTS: date is any valid date expression. <BR> EXAMPLE: <%=Month(#08/04/99#)%> <BR> RESULT: 8 <BR> <BR>MonthName() <BR> FUNCTION: Returns a string identifying the specified month. <BR> SYNTAX: MonthName(month, [, Abb]) <BR> ARGUMENTS: month is the numeric representation for a given month; Abb <BR>(optional) is a boolean value used to display month abbreviation. True <BR>will display the abbreviated month name and False (default) will not show <BR>the abbreviation. <BR> EXAMPLE: <%=MonthName(Month(#08/04/99#))%> <BR> RESULT: August <BR> <BR>Now() <BR> FUNCTION: Returns the current system date and time. <BR> SYNTAX: Now() <BR> ARGUMENTS: None <BR> EXAMPLE: <%=Now%> <BR> RESULT: 8/4/99 9:30:16 AM <BR> <BR>Replace() <BR> FUNCTION: Returns a string in which a specified sub-string has been <BR>replaced with another substring a specified number of times. <BR> SYNTAX: Replace(strToBeSearched, strSearchFor, strReplaceWith [, start <BR>][, count ][, compare]]]) <BR> ARGUMENTS: strToBeSearched is a string expression containing a sub-<BR>string to be replaced; strSearchFor is the string expression to search for <BR>within strToBeSearched; strReplaceWith is the string expression to replace <BR>sub-string strSearchFor; start (optional) is the numeric character <BR>position to begin search; count (optional) is a value indicating the <BR>comparision constant. <BR> EXAMPLE: <% <BR>strTest = "This is an apple!"<BR>response.write Replace(strTest, "apple", "orange")<BR>%> <BR> RESULT: This is an orange! <BR> <BR>Right() <BR> FUNCTION: 返回字符串右边第length个字符以前的字符(含第length个字符). <BR> SYNTAX: Right(string, length) <BR> ARGUMENTS: . <BR> EXAMPLE: <% <BR>strTest = "This is an test!"<BR>response.write Right(strTest, 3)<BR>%> <BR> RESULT: st! <BR> <BR>Rnd() <BR> FUNCTION: 产生一个随机数. <BR> SYNTAX: Rnd [ (number) ] <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>Randomize()<BR>response.write RND()<BR>%> <BR> RESULT: 任何一个在0 到 1 之间的数 <BR> <BR>Round() <BR> FUNCTION: 返回按指定位数进行四舍五入的数值. <BR> SYNTAX: Round(expression [, numRight]) <BR> ARGUMENTS: numRight数字表明小数点右边有多少位进行四舍五入。如果省略,则 <BR>Round 函数返回整数. <BR> EXAMPLE: <%<BR>i = 32.45678<BR>response.write Round(i)<BR>%> <BR> RESULT: 32 <BR> <BR>Rtrim() <BR> FUNCTION: 去掉字符串右边的字符串. <BR> SYNTAX: Rtrim(string) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>strTest = "This is a test!! "<BR>response.write RTrim(strTest)<BR>%> <BR> RESULT: This is a test!! <BR> <BR>Second() <BR> FUNCTION: 返回秒. <BR> SYNTAX: Second(time) <BR> ARGUMENTS: . <BR> EXAMPLE: <%=Second(#12:34:28 PM#)%> <BR> RESULT: 28 <BR> <BR>StrReverse() <BR> FUNCTION: 反排一字符串 <BR> SYNTAX: StrReverse(string) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>strTest = "This is a test!!"<BR>response.write StrReverse(strTest)<BR>%> <BR> RESULT: !!tset a si sihT <BR> <BR>Time() <BR> FUNCTION: 返回系统时间. <BR> SYNTAX: Time() <BR> ARGUMENTS: . <BR> EXAMPLE: <%=Time%> <BR> RESULT: 9:58:28 AM <BR> <BR>Trim() <BR> FUNCTION: 去掉字符串左右的空格. <BR> SYNTAX: Trim(string) <BR> ARGUMENTS: string is any valid string expression. <BR> EXAMPLE: <%<BR>strTest = " This is a test!! "<BR>response.write Trim(strTest)<BR>%> <BR> RESULT: This is a test!! <BR> <BR>UBound() <BR> FUNCTION: 返回指定数组维数的最大可用下标. <BR> SYNTAX: Ubound(arrayname [, dimension]) <BR> ARGUMENTS: ; dimension (optional) 指定返回哪一维上界的整数。1 表示第一<BR>维,2 表示第二维,以此类推。如果省略 dimension 参数,则默认值为 1. <BR> EXAMPLE: <%<BR>i = Array("Monday","Tuesday","Wednesday")<BR>response.write UBound(i)<BR>%> <BR> RESULT: 2 <BR> <BR>UCase() <BR> FUNCTION: 返回字符串的大写形式. <BR> SYNTAX: UCase(string) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>strTest = "This is a test!!"<BR>response.write UCase(strTest)<BR>%> <BR> RESULT: THIS IS A TEST!! <BR> <BR>VarType() <BR> FUNCTION: 返回指示变量子类型的值 <BR> SYNTAX: VarType(varName) <BR> ARGUMENTS: <BR> EXAMPLE: <%<BR>i = 3<BR>response.write varType(i)<BR>%> <BR> RESULT: 2(数字)详见"asp常数" <BR> <BR>WeekDay() <BR> FUNCTION: 返回在一周的第几天. <BR> SYNTAX: WeekDay(date [, firstdayofweek]) <BR> ARGUMENTS: . <BR> EXAMPLE: <%<BR>d = #8/4/99#<BR>response.write Weekday(d)<BR>%> <BR> RESULT: 4(星期三) <BR> <BR>WeekDayName() <BR> FUNCTION: 返回一周第几天的名字. <BR> SYNTAX: WeekDayName(weekday [, Abb ][, firstdayofweek]]) <BR> ARGUMENTS: Abb可选。Boolean 值,指明是否缩写表示星期各天的名称。如果省<BR>略, 默认值为 False,即不缩写星期各天的名称.firstdayofweek指明星期第一天的<BR>数值 <BR> EXAMPLE: <%<BR>d = #8/4/99#<BR>response.write WeekdayName(Weekday(d))<BR>%> <BR> RESULT: Wednesday <BR> <BR>Year() <BR> FUNCTION: 返回当前的年份. <BR> SYNTAX: Year(date) <BR> ARGUMENTS: <BR> EXAMPLE: <%=Year(#8/4/99#)%> <BR> RESULT: 1999 <BR>
<SCRIPT language=JavaScript src=""
type=text/JavaScript></SCRIPT>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD background=ASP实用函数库.files/body_3.gif width=9><IMG alt="" height=10
src="ASP实用函数库.files/body_3.gif" width=9></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=775>
<TBODY>
<TR>
<TD background=ASP实用函数库.files/body_1.gif width=4><IMG alt="" height=10
src="ASP实用函数库.files/body_1.gif" width=4></TD>
<TD vAlign=top>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=762>
<TBODY>
<TR>
<TD height=20 vAlign=top>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0
width="99%">
<TBODY>
<TR>
<TD height=5></TD></TR>
<TR>
<TD>
<TABLE align=center bgColor=#ffffff border=0 cellPadding=0
cellSpacing=0 width="99%">
<TBODY>
<TR>
<TD borderColor=#ffffff>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0
width="98%">
<TBODY>
<TR>
<TD>
<TABLE align=center border=0 cellPadding=0
cellSpacing=0 width="95%">
<TBODY>
<TR>
<TD align=right>
<TABLE align=right border=0 cellPadding=0
cellSpacing=0 width=250>
<TBODY>
<TR>
<TD align=left> </TD></TR>
<TR>
<TD align=left>文章作者:佚名</TD></TR>
<TR>
<TD align=left>文章来源:笨笨设计</TD></TR>
<TR>
<TD align=left>发布时间:2004年7月1日</TD></TR>
<TR>
<TD align=left height=20>浏览次数:
<SCRIPT language=JavaScript
src="ASP实用函数库.files/ar_count.htm"
type=text/JavaScript></SCRIPT>
次</TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=right>
<TABLE border=0 cellPadding=0 cellSpacing=0
width="100%">
<TBODY>
<TR>
<TD align=right> </TD>
<TD align=left> </TD>
<TD> </TD></TR>
<TR>
<TD align=right>『<A
href="http://bbsj.com/review.asp?title=ASP实用函数库"
target=_blank>发 表 评 论</A>』『<A
href="http://bbsj.com/sendmail.asp?num=ASP实用函数库"
target=_blank>文 章 推 荐</A>』『<A
href="http://bbsj.com/error.asp?title=ASP实用函数库"
target=_blank>报 告 错 误</A>』 </TD>
<TD align=left width=58><A
href="javascript:window.close()"><IMG border=0
height=15 src="ASP实用函数库.files/close.gif"
width=48></A></TD>
<TD width=38><A
href="http://bbsj.com/AR_net/net_ASP/200471144033.htm#top"><IMG
border=0 height=15 src="ASP实用函数库.files/top.gif"
width=38></A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD background=ASP实用函数库.files/body_3.gif width=9><IMG alt="" height=10
src="ASP实用函数库.files/body_3.gif" width=9></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=775>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -