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

asp 中常用的文件处理函数

asp 中常用的文件处理函数 收藏
asp 中处理文件上传以及删除时常用的自定义函数
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'所有自定义的VBS函数
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function DeleteFile(Filename) '删除文件
 if Filename<>"" then
  Set fso = server.CreateObject("Scripting.FileSystemObject")
  if fso.FileExists(Filename) then
   fso.DeleteFile Filename
  end if
  set fso = nothing
 end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function CreateDIR(byval LocalPath) '建立目录的程序,如果有多级目录,则一级一级的创建
 on error resume next
 LocalPath = replace(LocalPath,"\","/")
 set FileObject = server.createobject("Scripting.FileSystemObject")
 patharr = split(LocalPath,"/")
 path_level = ubound(patharr)
 for i = 0 to path_level
  if i=0 then pathtmp=patharr(0) & "/" else pathtmp = pathtmp & patharr(i) & "/"
  cpath = left(pathtmp,len(pathtmp)-1)
  if not FileObject.FolderExists(cpath) then FileObject.CreateFolder cpath
 next
 set FileObject = nothing
 if err.number<>0 then
  CreateDIR = false
  err.Clear
 else
  CreateDIR = true
 end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function SaveRandFileName(byval szFilename) '根据原文件名生成新的随机文件名
 randomize
 'ranNum=int(90000*rnd)+10000
 'if month(now)<10 then c_month="0" & month(now) else c_month=month(now)
 'if day(now)<10 then c_day="0" & day(now) else c_day=day(now) 
 'if hour(now)<10 then c_hour="0" & hour(now) else c_hour=hour(now)
 'if minute(now)<10 then c_minute="0" & minute(now) else c_minute=minute(now)
 'if second(now)<10 then c_second="0" & second(now) else c_second=minu


相关文档:

asp中使用FCKeditor存取数据时出现乱码问题解决方法

     把FCKeditor嵌入到ASP当中用来存取数据和上传文件时出现了乱码问题,网上查了下才知道自己做ASP是gb2312的编码,而fckeditor默认的编码是utf-8,因此出现了乱码问题。
    网上找了一些一些解决办法,最终有用的拿来吧。在FCKeditor/editor/filemanager/connector/asp目录下有两个 ......

ASP 内建对象


 
Active Server Pages 提供内建对象,这些对象使用户更容易收集通过浏览器请求发送的信息、响应浏览器以及存储用户信息(如用户首选项)。本文简要说明每一个对象。
Application 对象
可以使用 Application 对象使给定应用程序的所有用户共享信息。
Request 对象
可以使用 Request 对象访问任何用 HTTP 请 ......

ASP 编程中 20 个非常有用的例子

1.如何用Asp判断你的网站的虚拟物理路径
答:使用Mappath方法
< p align="center" >< font size="4" face="Arial" >< b >
The Physical path to this virtual website is:
< /b >< /font >
< font color="#FF0000" size="6" face="Arial" >
< %= Server.MapPath("\")% >
......

asp连接Mssql的方法及常见的错误

asp衔接Mssql的办法及常见的差错
//第一种写法:
MM_conn_STRING = "Driver={SQL Server};server=(local);uid=sa;pwd=;database=infs;"
Set conn = Server.Createobject("ADODB.Connection")
conn.open MM_conn_STRING
SET RS=SERVER.CreateObject("ADOBD.recordset")
SQL="SELECT * from TABLE ORDER BY ID DESC"
R ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号