VOOZH about

URL: https://www.geeksforgeeks.org/websites-apps/asp-attributes-property/

⇱ ASP Attributes Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

ASP Attributes Property

Last Updated : 24 Mar, 2021

The ASP Attributes Property is used for returning or setting the attributes of the specified file or folder. The attributes are defined with the following numerical values:

  • 0: Normal file
  • 1: Read-only file
  • 2: Hidden file
  • 4: System file
  • 6: Folder or directory
  • 32: The file has changed since the last backup
  • 1024: Link or shortcut
  • 2048: Compressed file

Syntax:

  • For a File Object:

    FileObject.Attributes[=newattributes]
  • For a Folder Object:

    FolderObject.Attributes[=newattributes]

Parameters: This property has a single parameter as mentioned above and described below:

  • newattributes: It specifies the attributes that have to be set for the given file or folder. It is an optional attribute.

The below examples demonstrate the ASP Attributes Property.

Example 1: The below code returns the attributes of the file.

Output:

The attributes of the file are: 1024

Example 2: The below code returns the attributes of the folder.

Output:

The attributes of the folder are: 18
Comment
Article Tags: