ASP AttributesAttributes
Полное справочное руководство по объекту File
Свойство Attributes используется для установки или возврата атрибутов указанного файла или папки.
Синтаксис
FileObject.Attributes[=newattributes]
FolderObject.Attributes[=newattributes]
FolderObject.Attributes[=newattributes]
| Parameters | Описание |
|---|---|
| newattributes | Необязательно. Задает значение атрибута файла или папки. Может быть одним из следующих значений или комбинацией следующих значений: 0 = Обычный файл. |
Пример для объекта File
<%
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
%>
Вывод:
Атрибуты файла: 32
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
%>
Вывод:
Атрибуты файла: 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
%>
Вывод:
Атрибуты папки: 16
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
%>
Вывод:
Атрибуты папки: 16
Полное справочное руководство по объекту File Другие расширения