易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP函数大全

 ASP函数与VBSCRIPT类似,以下举一些常用的函数 
 
Array() 
 
函数返回一个数组 
 
表达式 Array(list) 
 
允许数据类型: 字符,数字均可 
 
实例: <% 
 
Dim myArray() 
 
For i = 1 to 7 
 
Redim Preserve myArray(i) 
 
myArray(i) = WeekdayName(i) 
 
Next 
 
%> 
 
返回结果: 建立了一个包含7个元素的数组myArray 
 
myArray("Sunday","Monday", ... ... "Saturday" 
 
 
CInt() 
 
函数将一个表达式转化为数字类型 
 
表达式 CInt(expression) 
 
允许数据类型: 任何有效的字符均可 
 
实例: <% 
 
f = "234" 
 
response.write cINT(f) + 2 
 
%> 
 
返回结果: 236 
 
转化字符"234"为数字"234",如果字符串为空,则返回0值 
 
 
CreateObject() 
 
函数建立和返回一个已注册的ACTIVEX组件的实例。 
 
表达式 CreateObject(objName) 
 
允许数据类型: objName 是任何一个有效、已注册的ACTIVEX组件的名字. 
 
实例: <% 
 
Set con = Server.CreateObject("ADODB.Connection" 
 
%> 
 
 
CStr() 
 
函数转化一个表达式为字符串. 
 
表达式 CStr(expression) 
 
允许数据类型: expression 是任何有效的表达式。 
 
实例: <% 
 
s = 3 + 2 
 
response.write "The 返回结果 is: " & cStr(s) 
 
%> 
 
返回结果: 转化数字“5”为字符“5”。 
 
 
Date() 
 
函数返回当前系统日期. 
 
表达式 Date() 
 
允许数据类型: None. 
 
实例: <%=Date%> 
 
返回结果: 9/9/00 
 
 
DateAdd() 
 
函数返回一个被改变了的日期。 
 
表达式 DateAdd(timeinterval,number,date) 
 
允许数据类型: 
timeinterval is the time interval to add; 
number is amount of time intervals to add; 
and date is the starting date. 
 
实例: <% 
 
currentDate = #9/9/00# 
 
newDate = DateAdd("m",3,currentDate) 
 
response.write newDate 
 
%> 
 
 
<% 
 
currentDate = #12:34:45 PM# 
 
newDate = DateAdd("h",3,currentDate) 
 
response.write newDate 
 
%> 


相关文档:

如何用asp输出日期和星期

 第一种方法:
<%
    d = date()
 response.write d&"&nbsp;&nbsp;&nbsp;&nbsp;"&WeekdayName(Weekday(d))
    %>
输出样式:2004-5-7    星期五
************************************************************************* ......

asp将table生成excel文件xls

 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
if request("action")=1 then
 Response.ContentType="application/ms-excel"
 Response.AddHeader "content-disposition","attachment;filename=www.xls"
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//E ......

[ASP]防止后退,测试有效

 <head runat="server">
    <title></title>
    <meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
<script language="JavaScript"> ......

asp上传类

 1.UpLoadClass.asp
<%
Class UpLoadClass
Private p_MaxSize,p_FileType,p_SavePath,p_AutoSave,p_Error
Private objForm,binForm,binItem,strDate,lngTime
Public FormItem,FileItem
Public Property Get Version
Version=""
End Property
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号