ASP datecreated and ASP Attributes properties

Source: Internet
Author: User

We're all talking about ASP filesystem DateCreated and ASP Attributes properties Let's look at the ASP Attributes first.

The Attributes property is the file or folder specified by the property or property that is used to set or return.

Grammar
fileobject.attributes [= Newattributes]
folderobject.attributes [= Newattributes]

Parameter description
Newattributes Optional. The file or folder for the specified property value.
Any of the following values can be taken or combined:

0 = Normal File
1 = read-only file
2 = Hidden file
4 = System files
16 = folder or directory
32 = File changed since last backup
1024 = link or shortcut
2048 = Compressed File

Look at an example.

<%
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
Let's take a look at the folder instance.
<%
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 well, let's take a look at the example of the DateCreated properties of the ASP FSO. The DateCreated property is used to return the date and time specified by the file or folder that was created. Syntax fileobject.datecreated folderobject.datecreated look at the file operation <%
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 Instance two pairs of Folders instance folder tutorial. <%
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.