欢迎光临
我们一直在努力

ASP中如何将代码生成的文件设为只读-ASP教程,脚本编码

建站超值云服务器,限时71元/月

asp中如何将代码生成的文件设为只读

(01-2-25 137)

【hooke】 于 2001-2-21 17:12:14 加贴在 joy asp ↑:

attributes property

sets or returns the attributes of files or folders. read/write or read-only, depending on the attribute.

object.attributes [= newattributes]

arguments

object

required. always the name of a file or folder object.

newattributes

optional. if provided, newattributes is the new value for the attributes of the specified object.

settings

the newattributes argument can have any of the following values or any logical combination of the

following values:

constant value description

normal 0 normal file. no attributes are set.

readonly 1 read-only file. attribute is read/write.

hidden 2 hidden file. attribute is read/write.

system 4 system file. attribute is read/write.

directory 16 folder or directory. attribute is read-only.

archive 32 file has changed since last backup. attribute is read/write.

alias 1024 link or shortcut. attribute is read-only.

compressed 2048 compressed file. attribute is read-only.

remarks

attempts to change any of the read-only attributes (alias, compressed, or directory) are ignored.

when setting attributes, it is generally a good idea to first read the current attributes, then change the

individual attributes as desired, and finally write the attributes back.

the following code illustrates the use of the attributes property with a file:

function togglearchivebit(filespec)

dim fso, f

set fso = createobject("scripting.filesystemobject")

set f = fso.getfile(filespec)

if f.attributes and 32 then

f.attributes = f.attributes – 32

togglearchivebit = "archive bit is cleared."

else

f.attributes = f.attributes + 32

togglearchivebit = "archive bit is set."

end if

end function

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » ASP中如何将代码生成的文件设为只读-ASP教程,脚本编码
分享到: 更多 (0)

相关推荐

  • 暂无文章