首页 电脑学院 黑客教程 网站技术 网页特效 免费论文 公文写作 演讲发言 实用文档 职场指南 时尚生活 情感男女 其他资讯

您的位置:首页-> 网站技术-> ASP技术-> ASP中如何将代码生成的文件设为只读
ASP中如何将代码生成的文件设为只读
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中如何将代码生成的文件设为只读”来源于网络,版权归作者所有!勿用于商业用途。

ASP技术

ASP技术
PHP技术
JSP技术
.NET技术
服务器技术
数据库开发
其它类

本类阅读TOP10

·MDAC2.8 下载!
·ASP 编程中 20 个非常有用的例子——适合初学者
·ASP编程入门进阶(七):内置对象Server
·跟我学做树型菜单(四)
·教你1小时里搞定ASP
·IIS6.0的设置
·ASP分页祥解
·常用代码集锦(ASP)
·关于内部服务器500错误的文档
·新手初练:用ASP做一个域名查询系统

广告


关于本站|服务条款|广告服务|客服中心|发布文章|网站留言