国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

如何將代碼生成的文件設為只讀

2019-11-18 21:09:24
字體:
來源:轉載
供稿:網友
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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 磴口县| 疏附县| 泰顺县| 曲麻莱县| 灵武市| 临漳县| 昭平县| 满城县| 任丘市| 赣榆县| 高陵县| 涿鹿县| 商城县| 遂川县| 景洪市| 台北县| 张掖市| 沙河市| 贵港市| 六盘水市| 平顶山市| 江津市| 大名县| 湖南省| 滁州市| 鄂尔多斯市| 措勤县| 蒙城县| 南漳县| 林芝县| 马尔康县| 同江市| 瑞安市| 泗水县| 广饶县| 武乡县| 宜昌市| 丹巴县| 贡山| 章丘市| 合江县|