asp采集常用的几个FUCTION
作者:郁郁小蝎 来源:中国站长学院 时间:2007-09-05 19:45:00
asp采集常用的几个FUCTION如:利用流保存文件,利用fso检测文件是否存在,利用fso检测文件夹是否存在,保存文件,取得远程数据等
1. function SaveFiles
作用 :利用流保存文件
参数 :from(远程文件地址),tofile(保存文件位置)
Private Function SaveFiles(byref from,byref tofile)
Dim Datas
Datas=GetData(from,0)
Response.Write "保存成功:<font color=red>"&formatnumber(len(Datas)/1024*2,2)&"</font>Kb"
response.Flush
if formatnumber(len(Datas)/1024*2,2)>1 then
ADOS.Type = 1
ADOS.Mode =3
ADOS.Open
ADOS.write Datas
ADOS.SaveToFile server.mappath(tofile),2
ADOS.Close()
else
Response.Write "保存失败:<font color=red>文件大小"&formatnumber(len(imgs)/1024*2,2)&"Kb,小于1K</font>"
response.Flush
end if
end function
2.function IsExists
作用 :利用fso检测文件是否存在,存在返回true,不存在返回false
参数 :filespes(文件位置)
Private Function IsExists(byref filespec)
If (FSO.FileExists(server.MapPath(filespec))) Then
IsExists = True
Else
IsExists = False
End If
End Function
3. function IsFolder
作用 :利用fso检测文件夹是否存在,存在返回true,不存在返回false
参数 :folder(文件夹位置)
Private Function IsFolder(byref Folder)
If FSO.FolderExists(server.MapPath(Folder)) Then
IsFolder = True
Else
IsFolder = False
End If
End Function
4. function CreateFolder
作用 :利用fso创建文件夹
参数 :fldr(文件夹位置)
Private Function CreateFolder(byref fldr)
Dim f
Set f = FSO.CreateFolder(Server.MapPath(fldr))
CreateFolder = f.Path
Set f=nothing
End Function
标签:采集,function,asp
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
各种SQL语句速查手册
2007-09-27 19:31:00
CSS图片代码效果汇总
2008-09-04 12:14:00
Google logo “我的中国”谷歌国际少年绘画大赛小学1-3年级
2008-12-19 12:26:00
![](https://img.aspxhome.com/file/UploadPic/200812/19/j1-3_01-72s.jpg)
sql exist的妙用
2007-11-08 11:47:00
可爱动态背景输入框
2009-05-07 13:50:00
ASP:一个网站空间多个域名访问
2008-11-21 17:03:00
HMAC算法--asp源码
2009-08-28 12:51:00
用户研究中的人物角色
2010-02-08 12:15:00
ASP获取远程文件大小信息(通过header头信息)
2010-03-11 21:25:00
36个折纸风格logo设计
2009-09-17 13:13:00
![](https://img.aspxhome.com/file/UploadPic/20099/17/origami-logos-01-26s.jpg)
解构用户研究
2010-03-15 12:34:00
![](https://img.aspxhome.com/file/UploadPic/20103/15/deconstructing_user_research_banner730-250-33s.jpg)
什么是UE,UED?
2008-07-24 13:26:00
asp好用的函数集分享
2011-09-13 12:49:07
一个向上滚动代码
2010-02-10 12:29:00
![](https://img.aspxhome.com/file/UploadPic/20102/10/2010210123159245s.gif)
Oracle SID存在解決方法
2009-06-19 17:34:00
HTML语言将加入硬件操作功能
2009-12-16 19:19:00
![](https://img.aspxhome.com/file/UploadPic/200912/16/01-55s.jpg)
最新屏蔽百度快照的方法
2009-07-06 14:37:00
ASP中使用SQL语句教程
2008-09-03 12:17:00
SQL Server数据转换服务基本概念介绍
2009-01-20 15:52:00
如何获知用户的IP?
2009-11-24 20:52:00