网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP实例
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.制作我们自己的Ebay(拍卖系统)(4).
.制作我们自己的Ebay(拍卖系统)(8).
.网络寻呼机数据库版隐藏文件watc.
.bbs树形结构的实现方法(一).
.制作一个简单的服务器端控制.
.filesystemobject组件的用法示例.
.在ASP中改善动态分页的性能.
.ASP生成Word文档的又一方法.
.在线实时开通WEB及FTP源程序.
.采用XMLHTTP编写一个天气预报的程.
.最简洁的多重查询的解决方案.
.ASP直接调用EXCEL数据的例子(不.
.制作我们自己的Ebay(拍卖系统)(5).
.让自定义文件下载支持断点续传.
.多图片上传到指定的目录并存到数.
.ASP随机涵数生成100条8位字母和数.
.一个免费的邮件列表源程序(二).
.用ASP开发一个在线考试程序(九).
.简单ASP论坛DIY.
.用SQL Server为Web浏览器提供图像.

ASP中的函数应用方法及应用举例(二)

发表日期:2000-8-25


21. IsObject()
  FUNCTION: Returns a boolean value indicating whether an expression refers to an automation object.
  SYNTAX: IsObject(expression)
  ARGUMENTS: expression is any valid expression.
  EXAMPLE: <%
Set con = Server.CreateObject("ADODB.Connection")
response.write IsObject(con)
%>
  RESULT: True
-------------------------------------
  
22. LBound()
  FUNCTION: Returns the base index value for a dimension of any array.
  SYNTAX: Lbound(arrayname [, dimension])
  ARGUMENTS: arrayname is the name of any array; dimension is an optional number indicating the dimension
to find the lower bound.
  EXAMPLE: <%
i = Array("Monday","Tuesday","Wednesday")
response.write LBound(i)
%>
  RESULT: 0
-------------------------------------
  
23. LCase()
  FUNCTION: Returns a string that has been converted into lowercase characters.
  SYNTAX: Lcase(string)
  ARGUMENTS: string is any valid string expression.
  EXAMPLE: <%
strTest = "This is a test!"
response.write LCase(strTest)
%>
  RESULT: this is a test!
-------------------------------------
  
24. Left()
  FUNCTION: Returns the number of characters from the left side of a string.
  SYNTAX: Left(string, length)
  ARGUMENTS: string is any valid string expression; length is the length of characters to return.
  EXAMPLE: <%
strTest = "This is a test!"
response.write Left(strTest, 3)
%>
  RESULT: Thi
-------------------------------------
  
25. Len()
  FUNCTION: Returns the number of characters in a string or the number of bytes required to store a
variable.
  SYNTAX: Len(string | varName)
  ARGUMENTS: string is any valid string expression; varName is any valid variable name.
  EXAMPLE: <%
strTest = "This is a test!"
response.write Len(strTest)
%>
  RESULT: 15
(The total length of strTest is 15 characters)
26.  
LTrim()
  FUNCTION: Returns a string without leading spaces.
  SYNTAX: LTrim(string)
  ARGUMENTS: string is any valid string expression.
  EXAMPLE: <%
strTest = " This is a test!"
response.write LTrim(strTest)
%>
  RESULT: This is a test!
-------------------------------------
  
27. Mid()
  FUNCTION: Returns a specified number of characters from a string.
  SYNTAX: Mid(string, start [, length])
  ARGUMENTS: string is any valid string expression; start is a numeric character position to begin
extraction from; length (optional) is the number of characters to return.
  EXAMPLE: <%
strTest = "This is a test! Today is Monday."
response.write Mid(strTest, 17, 5)
%>
  RESULT: Today
-------------------------------------
  
28. Minute()
  FUNCTION: Returns the number of the minutes in current system time.
  SYNTAX: Minute(time)
  ARGUMENTS: time is any valid time expression.
  EXAMPLE: <%=Minute(#12:45:32 PM#)%>
  RESULT: 45
-------------------------------------
  
29. Month()
  FUNCTION: Returns the number of the month of the year.
  SYNTAX: Month(date)
  ARGUMENTS: date is any valid date expression.
  EXAMPLE: <%=Month(#08/04/99#)%>
  RESULT: 8
-------------------------------------
  
30. MonthName()
  FUNCTION: Returns a string identifying the specified month.
  SYNTAX: MonthName(month, [, Abb])
  ARGUMENTS: month is the numeric representation for a given month; Abb (optional) is a boolean value used
to display month abbreviation. True will display the abbreviated month name and False (default) will not
show the abbreviation.
  EXAMPLE: <%=MonthName(Month(#08/04/99#))%>
  RESULT: August
-------------------------------------
  
31. Now()
  FUNCTION: Returns the current system date and time.
  SYNTAX: Now()
  ARGUMENTS: None
  EXAMPLE: <%=Now%>
  RESULT: 8/4/99 9:30:16 AM
-------------------------------------
  
32. Replace()
  FUNCTION: Returns a string in which a specified sub-string has been replaced with another substring a
specified number of times.
  SYNTAX: Replace(strToBeSearched, strSearchFor, strReplaceWith [, start [, count [, compare]]])
  ARGUMENTS: strToBeSearched is a string expression containing a sub-string to be replaced; strSearchFor
is the string expression to search for within strToBeSearched; strReplaceWith is the string expression to
replace sub-string strSearchFor; start (optional) is the numeric character position to begin search; count
(optional) is a value indicating the comparision constant.
  EXAMPLE: <%
strTest = "This is an apple!"
response.write Replace(strTest, "apple", "orange")
%>
  RESULT: This is an orange!
-------------------------------------
  
33. Right()
  FUNCTION: Returns a specified number of characters from the right side of a string.
  SYNTAX: Right(string, length)
  ARGUMENTS: string is any valid string expression; length is any valid numeric expression representing
the number of characters to return.
  EXAMPLE: <%
strTest = "This is an test!"
response.write Right(strTest, 3)
%>
  RESULT: st!
-------------------------------------
  
34. Rnd()
  FUNCTION: Returns a random number.
  SYNTAX: Rnd [ (number) ]
  ARGUMENTS: number is any valid numeric expression.
  EXAMPLE: <%
Randomize()
response.write RND()
%>
  RESULT: Any number between 0 and 1
(Without Randomize(), the number will not re-generate)
  
Round()
  FUNCTION: Returns a number rounded to a specified number of decimal places.
  SYNTAX: Round(expression [, numRight])
  ARGUMENTS: expression is any valid numeric expression to be rounded; numRight (optional) is any numeric
expression used to indicate the number of digits to the right of the decimal point.
  EXAMPLE: <%
i = 32.45678
response.write Round(i)
%>
  RESULT: 32
-------------------------------------
  
35. Rtrim()
  FUNCTION: Returns a copy of a string without trailing spaces.
  SYNTAX: Rtrim(string)
  ARGUMENTS: string is any valid string expression.
  EXAMPLE: <%
strTest = "This is a test!! "
response.write RTrim(strTest)
%>
  RESULT: This is a test!!
-------------------------------------
  
36. Second()
  FUNCTION: Returns the current seconds value of the current system time.
  SYNTAX: Second(time)
  ARGUMENTS: time is any valid time expression.
  EXAMPLE: <%=Second(#12:34:28 PM#)%>
  RESULT: 28
-------------------------------------
  
37. StrReverse()
  FUNCTION: Returns a string where the character order has been reversed
  SYNTAX: StrReverse(string)
  ARGUMENTS: string is any valid string expression
  EXAMPLE: <%
strTest = "This is a test!!"
response.write StrReverse(strTest)
%>
  RESULT: !!tset a si sihT
-------------------------------------
  
38. Time()
  FUNCTION: Returns the current system time.
  SYNTAX: Time()
  ARGUMENTS: None.
  EXAMPLE: <%=Time%>
  RESULT: 9:58:28 AM
-------------------------------------
  
39. Trim()
  FUNCTION: Returns a string without leading and trailing spaces.
  SYNTAX: Trim(string)
  ARGUMENTS: string is any valid string expression.
  EXAMPLE: <%
strTest = " This is a test!! "
response.write Trim(strTest)
%>
  RESULT: This is a test!!
-------------------------------------
  
40. UBound()
  FUNCTION: Returns the largest available subscipt for a dimension of an array.
  SYNTAX: Ubound(arrayname [, dimension])
  ARGUMENTS: arrayname is the name of a valid array; dimension (optional) is a number indicating the
dimension to find the upper bound.
  EXAMPLE: <%
i = Array("Monday","Tuesday","Wednesday")
response.write UBound(i)
%>
  RESULT: 2
(array index starts with 0)
-------------------------------------
  
41. UCase()
  FUNCTION: Returns a string that has been converted to uppercase characters.
  SYNTAX: UCase(string)
  ARGUMENTS: string is any valid string expression.
  EXAMPLE: <%
strTest = "This is a test!!"
response.write UCase(strTest)
%>
  RESULT: THIS IS A TEST!!
-------------------------------------
  
42. VarType()
  FUNCTION: Returns the subtype of a variable
  SYNTAX: VarType(varName)
  ARGUMENTS: varName is the required variable name
  EXAMPLE: <%
i = 3
response.write varType(i)
%>
  RESULT: 2
(2 indicates Integer. Refers to ASP Constants)
-------------------------------------
  
43. WeekDay()
  FUNCTION: Returns a whole number representing the day of the week.
  SYNTAX: WeekDay(date [, firstdayofweek])
  ARGUMENTS: date is any valid date expression; firstdayofweek is an optional date constant to assign the
first day of week.
  EXAMPLE: <%
d = #8/4/99#
response.write Weekday(d)
%>
  RESULT: 4
(4 indicates the fourth of the week, which is Wednesday)
-------------------------------------
  
44. WeekDayName()
  FUNCTION: Returns the specified day of the week.
  SYNTAX: WeekDayName(weekday [, Abb [, firstdayofweek]])
  ARGUMENTS: weekday is the numeric representation for the day of the week; Abb is an optional boolean
value (if set to true, the weekday name will be abbreviated; if set to false, the full weekday name is
displayed); and firstdayofweek is an optional date constant to assign the first day of week.
  EXAMPLE: <%
d = #8/4/99#
response.write WeekdayName(Weekday(d))
%>
  RESULT: Wednesday
-------------------------------------
  
45. Year()
  FUNCTION: Returns the current year.
  SYNTAX: Year(date)
  ARGUMENTS: date is any valid date expression.
  EXAMPLE: <%=Year(#8/4/99#)%>
  
上一篇:ASP中的函数应用方法及应用举例(一) 人气:12489
下一篇:完整的访问统计系统(一:数据库篇) 人气:12367
浏览全部ASP中的函数应用方法及应用举例的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐