摘要
为了在Windows98/95中一次性设置某文件夹下的所有文件的属性(如只读、存档、系统和隐藏属性等),文中通过VB中的文件控件(DriveListBox,DirListBox和FileListBox)的协同工作,并利用递归算法来达到遍历该目录下所有文件的目的。在遍历文件的过程中,通过相应的WindowsAPI函数将所有文件设置成所需要的属性。在VB上编程实现了该算法,程序结果显示本算法的可行性且具有极高的灵活性。
In order to set the attribute (such as the attributes of read only,archive,system and hidden,etc.) of the files under some folder in one times,propose a recursion algorithm which utilize the file controls in VB to traversal all of the files under this folder by recursion.In the processing of traversal,the attribute of the files are set by Windows API function. The algorithm is implemented in VB and the running results shows that algorithm is feasible and has great flexibility.
出处
《微机发展》
2004年第5期102-104,共3页
Microcomputer Development