广·西·电·脑·服·务·网                                     设为首页  收藏本站
首 页 IT 报 道 操作系统 硬件学院 软件学院 网络学院 服 务 器 软件下载
DIY经验 数据恢复 维修宝典 电脑保养 故障症状 黑客安全 病毒快报 电脑优化
维修网点 IT 黄 页 网络游戏 大师答疑 网站技术 动漫游戏 服务社区 素材图片
 广西电脑服务网 ·广西最大的电脑服务平台
您现在的位置: 广西电脑维修在线 >> 网站技术 >> ASP技术 >> ASP应用 >> 网站技术正文
在ASP中如何将代码生成的文件设为只读
作者:佚名 文章来源:不详 点击数: 更新时间:2007-2-4 12:34:16


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





 
网站技术录入:admin    责任编辑:admin 
  • 上一篇网站技术:

  • 下一篇网站技术:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

     IT图片报道

    联想D222到货22寸LCD迅速串红市场

    入门超频王!双敏945PL狂跑1200 F

    冠捷春季新品197V+突破高对比上市

    核心500MHz!性价比王者双敏X1650
     IT热点报道

    普通IT报道 联想D222到货22寸LCD迅速串红市场
    推荐IT报道 入门超频王!双敏945PL狂跑1200 FSB!
    推荐IT报道 冠捷春季新品197V+突破高对比上市
    普通IT报道 核心500MHz!性价比王者双敏X1650GT登场!
    普通IT报道 549元双敏945GC主板到货!
    普通IT报道 宏碁笔记本存储王As3683升级送礼!
    普通IT报道 魅族MP3全线暴跌 M6SP4G版不足700
    普通IT报道 OPPO首款顶级4.3寸大屏MP4 A3上市
    普通IT报道 维修服务拯救PC,谁拯救维修服务?
    普通IT报道 影驰8800GTS游戏盒子上市
    关于公司 | 免责声明 | 广告服务 | 招贤纳士 | 联系我们 | 友情链接 | 网站地图 1 2 3
    Copyright@2005 - 2006  http://www.GXF.com.cn  All Right Reserved  
    桂ICP备06002242号

    技术咨询
    22097366
    10231086
    30636841
    技术交流群
    27717914