設置或返回文件或文件夾的屬性。 根據不同屬性為讀/寫或只讀。
object.Attributes [= newattributes]
object
必選項。 應為 File 或 Folder 對象的名稱。
newattributes
可選項。 假如提供了這個部分,那么 newattributes 將成為指定的 object 的新屬性值。
newattributes 參數可以是下列各值或者這些值的任意邏輯組合:
下面的代碼通過一個文件說明了 Attributes 屬性的用法:
function ToggleArchiveBit(filespec){var fso, f, r, s;fso = new ActiveXObject("Scrf = fso.GetFile(filespec)if (f.attributes && 32){f.attributes = f.attributes - 32;s = "Archive bit is cleared.";}else{f.attributes = f.attributes + 32;s = "Archive bit is set.";}return(s);}
DateCreated 屬性 DateLastaccessed 屬性 DateLastModified 屬性 Drive 屬性 Files 屬性 IsRootFolder 屬性 Name 屬性 ParentFolder 屬性 Path 屬性 ShortName 屬性 ShortPath 屬性 Size 屬性 SubFolders 屬性 Type 屬性
應用于: File 對象 Folder 對象
新聞熱點
疑難解答