硬件学院 | 网络学院 | 游戏秘籍 | 求职技巧 | 企业管理 | 软件资讯 | IT导购 | 软件下载 | 源码下载
软件学院 | 安全资讯 | 图形图象 | 网络营销 | 电子商务 | 硬件资讯 | IT生活 | 教程下载 | 电影娱乐
网站首页    个人求职    单位招聘    高校联盟    猎头服务    培训服务    资讯中心    IT论坛
让每一个热爱IT的人都找到一份满意的工作!
文章搜索:
 您的位置首页->-> 软件学院-> ASP技术-> ASP中如何将代码生成的文件设为只读
ASP中如何将代码生成的文件设为只读
作者:中国资讯网 来源:zixuen.com 加入时间:2005-5-12 www.cnitrc.com
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

  相关文章:
ASP技术
ASP技术
PHP技术
JSP技术
.NET技术
服务器技术
数据库技术
其它类
工具软件
办公软件
本类阅读TOP10
 
关于我们   |   服务声明   |   使用帮助   |   广告合作   |   网站地图   |   友情链接   |   加盟合作   |   联系我们
Copyright © 2006 cnitrc.com Inc. All Rights Reserved. 浙ICP备05074295号
中国IT人才网 版权所有 网络实名:中国IT人才
未经书面授权严禁转载和复制本站的任何招聘信息和文章