FSO的ASP文件操作大全
ASP中FSO文件操作大全,这里几乎上包括了所有的对文件的操作
<%
Class Cls_FSO
Public objFSO
Private Sub Class_Initialize()
Set objFSO = Server.CreateObject("s cripting.FileSystemObject")
End Sub
Private Sub class_terminate()
Set objFSO = Nothing
End Sub
'=======文件操作========
'取文件大小
Public Function GetFileSize(FileName)
Dim f
If ReportFileStatus(FileName) = 1 Then
Set f = objFSO.Getfile(FileName)
GetFileSize = f.Size
Else
GetFileSize = -1
End if
End Function
'文件删除
Public Function deleteAFile(FileSpec)
If ReportFileStatus(FileSpec) = 1 Then
objFSO.deleteFile(FileSpec)
deleteAFile = 1
Else
deleteAFile = -1
End if
End Function
'显示文件列表
Public Function ShowFileList(FolderSpec)
Dim f, f1, fc, s
If ReportFolderStatus(FolderSpec) = 1 Then
Set f = objFSO.GetFolder(FolderSpec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & "|"
Next
ShowFileList = s
Else
ShowFileList = -1
End if
End Function
'文件复制
Public Function CopyAFile(SourceFile, DestinationFile)
Dim MyFile
If ReportFileStatus(SourceFile) = 1 Then
Set MyFile = objFSO.GetFile(SourceFile)
MyFile.Copy (DestinationFile)
CopyAFile = 1
Else
CopyAFile = -1
End if
End Function
'文件移动
Public Function MoveAFile(SourceFile,DestinationFile)
If ReportFileStatus(SourceFile) = 1 And ReportFileStatus(DestinationFileORPath) = -1 Then
objFSO.MoveFile SourceFile,DestinationFileORPath
MoveAFile = 1
Else
MoveAFile = -1
End if
End Function
'文件是否存在?
Public Function ReportFileStatus(FileName)
Dim msg
msg = -1
If (objFSO.FileExists(FileName)) Then
msg = 1
Else
msg = -1
End If
ReportFileStatus = msg
End Function
'文件创建日期
Public Function ShowDatecreated(FileSpec)
Dim f
If ReportFileStatus(FileSpec) = 1 Then
Set f = objFSO.GetFile(FileSpec)
ShowDatecreated = f.Datecreated
Else
ShowDatecreated = -1
End if
End Function
'文件属性
Public Function GetAttributes(FileName)
Dim f
Dim strFileAttributes
If ReportFileStatus(FileName) = 1 Then
Set f = objFSO.GetFile(FileName)
select Case f.attributes
Case 0 strFileAttributes = "普通文件。没有设置任何属性。 "
Case 1 strFileAttributes = "只读文件。可读写。 "
Case 2 strFileAttributes = "隐藏文件。可读写。 "
Case 4 strFileAttributes = "系统文件。可读写。 "
Case 16 strFileAttributes = "文件夹或目录。只读。 "
Case 32 strFileAttributes = "上次备份后已更改的文件。可读写。 "
Case 1024 strFileAttributes = "链接或快捷方式。只读。 "
Case 2048 strFileAttributes = " 压缩文件。只读。"
End select
GetAttributes = strFileAttributes
Else
GetAttributes = -1
End if
End Function
'最后一次访问/最后一次修改时间
Public Function ShowFileAccessInfo(FileName,InfoType)
'//功能:
FSO的ASP文件操作大全 3页 免费 asp之fso操作大全 3页 1下载券 ASP FSO...<% '建立文件夹函数 Function CreateFolder(strFolder)'参数为相对路径 '首选判断...
ASP FSO文件处理函数大全_计算机软件及应用_IT/计算机_专业资料。ASP FSO 文件处理函数大全 代码 <%? '建立文件夹函数? Function?CreateFolder(strFolder)'参数为...
FSO - FileSystemObject 或 Scripting.FileSystemObject 的缩写,为 IIS 内置组件,用于操作磁盘、文件夹或文本文件。FSO 的对象、方法和属性非常的多,这里用示例的方式...
asp 操作文件FSO 2页 2下载券 ASP的FSO组件比较全的例... 6页 1下载券 ...asp fso 代码大全2007-08-23 21:50对于一个支持asp和fso的空间来说有了fso...
asp fso 代码大全 3页 1财富值 asp 操作文件FSO 2页 5财富值 ASP的FSO组件比较全的例子 6页 1财富值搜你所想,读你所爱 拒绝盗版,营造绿色文库 如要...
FSO 函数大全(ASP 读,写,删除,复制,移动文件或目录,获取属性等).txt 大人物的悲哀在于他 们需要不停地做出选择; 而小人物的悲哀在于他们从来没有选择的机会。...
asp 操作文件FSO 2页 2下载券 FSO的ASP文件操作大全 3页 免费 ASP中文本...网址http://www.mybdqn.com/ 电话 010-62516562 企业 QQ 800001099 ASP 中 ...
ASP FSO操作文件(复制文件、重命名文件、删除文件、替换字符串)_IT/计算机_... asp之fso操作大全 3页 1下载券 FSO函数大全(ASP读,写,删... 8页 免费 ...
asp 操作文件FSO 2页 5财富值 FSO的ASP文件操作大全 3页 免费 ASP版FSO... 网址http://www.mybdqn.cn/ 企业 QQ 800001099 ASP 中 FSO 的神奇功能 -...
ASP版FSO文件管理_IT/计算机_专业资料。ASP版完全应用FSO实现在线进行文件管理,... asp之fso操作大全 3页 1下载券 VBS脚本文件操作总结FSO... 6页 免费...
热门文档