一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

ASP DateCreated 与ASP Attributes 属性

时间:2008-11-04 编辑:简简单单 来源:一聚教程网

我们都是讲关于ASP filesystem  DateCreated 与ASP Attributes 属性 下面我们先看看ASP Attributes 吧.

Attributes的属性是用来设置或返回的属性或属性指定的文件或文件夹。

语法
FileObject.Attributes [ = newattributes ]
FolderObject.Attributes [ = newattributes ]

参数说明
newattributes可选。指定的属性值的文件或文件夹。
可采取下列任何一种价值观念或结合以下值:

0 =正常文件
1 =只读文件
2 =隐藏文件
4 =系统文件
16 =文件夹或目录
32 =文件改变了自上次备份
1024 =连结或捷径
2048 =压缩文件

看个实例.

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:test.txt")
Response.Write("The attributes of the file are: ")
Response.Write(f.Attributes)
set f=nothing
set fs=nothing
%>
Output:

The attributes of the file are: 32
再来看看文件夹实例folder
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:test")
Response.Write("The attributes of the folder are: ")
Response.Write(fo.Attributes)
set fo=nothing
set fs=nothing
%>Output:The attributes of the folder are: 16好了下面再来看看ASP FSO 的DateCreated属性的实例吧.该DateCreated财产用于归还日期和时间指定的文件或文件夹已创建。 语法FileObject.DateCreated FolderObject.DateCreated看看对文件file操作<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:test.txt")
Response.Write("File created: ")
Response.Write(f.DateCreated)
set f=nothing
set fs=nothing
%>Output:File created: 9/19/2001 10:01:19 AM实例二对文件夹实例folder教程.<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:test")
Response.Write("Folder created: ")
Response.Write(fo.DateCreated)
set fo=nothing
set fs=nothing
%>Output:Folder created: 9/19/2001 10:01:19 AM

热门栏目