VB如何改变文件属性
来源:百度知道 编辑:UC知道 时间:2024/09/28 11:59:40
最好给个代码 本人谢谢了
Function ChangeFileAttributes(strPath As String, _
Optional lngSetAttr As FileAttribute, _
Optional lngRemoveAttr As FileAttribute, _
Optional blnRecursive As Boolean) As Boolean
' This function takes a directory path, a value specifying file
' attributes to be set, a value specifying file attributes to be
' removed, and a flag that indicates whether it should be called
' recursively. It returns True unless an error occurs.
Dim fsoSysObj As FileSystemObject
Dim fdrFolder As Folder
Dim fdrSubFolder As Folder
Dim filFile As File
' Return new FileSystemObject.
Set fsoSysObj = New FileSystemObject
On Error Resume Next
' Get folder.
Set fdrFolder = fsoSysObj.GetFolder(strPath)
If Err <> 0 Then