易截截图软件、单文件、免安装、纯绿色、仅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通过cookie实现自动记住密码的功能

 ASP通过cookie实现自动记住密码的功能
把以下代码加入验证页:
<%if Trim(Cstr(request.QueryString("check")))="true" then ‘用来判断是否有选择记住密码
Response.Cookies("UserCookie")("username") = Trim(Cstr(request.Form("username")))
Response.Cookies("UserCookie")("passwords") = trim ......

ASP用ADODB.Stream写UTF

Function WriteToUTF(content,sFilen)'content为替换后的字符串,filename为生成的文件名
 dim objStream 
   Set objStream = Server.CreateObject("ADODB.Stream")  
     With objStream  
     .Open  
 &nb ......

[ASP]动态绑定数据源的GridView添加行 (技术备份)

 GridView 为动态绑定 DataSet,结果 (DataSet)dt = grid1.DataSource 拿不到东西,想偷懒直接添加行不行了, 只好用最笨的办法,把GridView的东西倒成DataSet,然后在DataSet里加行,最后回绑gridview
try里面的
DataTable dtable = new DataTable("tb1");
        
&n ......

[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号