Open In App

ASP Attributes Property

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:

Syntax:



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

The below examples demonstrate the ASP Attributes Property.

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




<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
  
'Getting the file
set f=fs.GetFile("d:\GFG.txt")
Response.Write("The attributes of the file are: ")
  
'Getting the attributes of the file
Response.Write(f.Attributes)
  
set f=nothing
set fs=nothing
%>

Output:

The attributes of the file are: 1024

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




<%
dim fs,folder
set fs=Server.CreateObject("Scripting.FileSystemObject")
    
'Getting the folder
set folder=fs.GetFolder("d:\geeks")
  
Response.Write("The attributes of the folder are: ")
  
'Getting the attributes of the folder
Response.Write(folder.Attributes)
    
set folder=nothing
set fs=nothing
%>

Output:

The attributes of the folder are: 18

Article Tags :