版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、第七讲 文件管理,一、基本概念:,1. 文件:同一类型元素的有序集合,是内存与外设之间传输数据的通道。 2.文件的组织与管理形式: 驱动器: 文件夹: 文件:,二、Delphi7文件管理方式:,DriverComboBox or ShellComboBox,FilelistBox or ShellListView,DirectoryListBox or ShellTreeView,1. Win3.1选项卡上的文件管理组件 驱动器组合列表框(DriveComboBox) 常用属性: DirList: 指定关联的目录列表框; Driver: 运行时属性 目录列表框(DirectoryListBox
2、) 常用属性: FileList: 指定关联的文件列表框 DirLabel: 记录当前的目录路径(When the current directory changes in the directory list box, the change is reflected in the caption of the label.) Driver: 运行时属性 Directory: 运行时属性,文件列表框(FileListBox): 常用属性: MultiSelect: Drive: 运行时属性 Diretory: 运行时属性 FileName: 运行时属性 FileType: 显示文件的属性(默认
3、ftNormal) FileEdit: set FileEdit to an edit control that displays the selected file from the file list box, as is commonly done in Open and Save dialog boxes.,type TFileAttr = (ftReadOnly, ftHidden, ftSystem, ftVolumeID, ftDirectory, ftArchive, ftNormal); TFileType = set of TFileAttr;,文件类型过滤组合列表框(Fi
4、lterComboBox) 常用属性: FileList:set FileList to allow the filter combo box to limit which files are displayed in the FileListbox. Filter:To create the value of Filter for a single file type, follow these steps: 1 Type some meaningful text to indicate the type of file. 2 Type a | character (vertical bar
5、). 3 Type the file filter. Dont put in any spaces around the | character in the string. Heres an example: FilterComboBox1.Filter := Text files|*.TXT; FilterComboBox1-Filter = Text files|*.TXT;,To specify multiple file filters, extend the value of Filter, separating each file name/mask combination wi
6、th a | character. Heres an example of two file filters that could be specified as the value of the Filter property: Text files (*.TXT)|*.TXT|Pascal files (*.PAS)|*.PAS Text files (*.TXT)|*.TXT|C+ files (*.CPP)|*.CPP,实例:,2 Samples选项卡上的文件管理组件,ShellTreeView组件: 常用属性: Root: ShellComboBox: ShellListView:
7、ShellComboBox组件: 常用属性: ShellTreeView: ShellListView:,ShellListView组件: 常用属性: ShellTreeView: ShellCombox: Viewstyle: Set ViewStyle to control the visual display of items in a list view. (vsIcon、vsList、vsSmallIcon、vsReport),实例:资源管理器,三、文件管理函数和过程:,功能:实现对文件的管理。 删除文件 文件重命名 创建文件夹 删除文件夹,function RenameFile(c
8、onst OldName, NewName: string): Boolean; example: if not RenameFile(c:abc.bmp,abc.doc) then showmessage(Can not rename file!); function DeleteFile(const FileName: string): Boolean; Description: DeleteFile deletes the file named by FileName from the disk. If the file cannot be deleted or does not exist, the function returns false. function FileExists(const FileName: string): Boolean; De
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026燃气宣传面试题及答案
- 2026森林四库面试题及答案
- 2026少先队大队面试题及答案
- 2026石油银行面试题目及答案
- 文县离婚协议书
- 老公赠与镯子合同范本
- 小型水库转让协议书
- 领养收养寄养协议书
- 老人由子女抚养协议书
- 2026文旅模拟面试题及答案
- 2026云南昆明滇池国家旅游度假区政务服务局政务服务中心聘综合窗口辅助性人员1人考试备考题库及答案详解
- 摩根大通-第一性原理:AI电力基础设施:追踪电力需求-First Principles-AI Power Infrastructure:Following the Power-20260625
- 【中考真卷】台湾省2026年初中物理学业水平考试(含答案)
- 修订一单一库质量手册和程序文件参考文件
- 2026云南昆明医科大学第二附属医院面向社会招聘非事业编制人员29人备考题库带答案详解
- 焊工理论考试题及答案2026年
- 清华大学2026年强基计划招生笔试模拟试题及答案解析
- 空调器装配工班组考核水平考核试卷含答案
- 全省煤矿安全风险隐患专项整治行动必查事项清单
- 机械加工企业安全生产风险分级管控清单
- 2026年农商行面试题及答案
评论
0/150
提交评论