File[] oFiles=Directory.GetFiles(strPath);这句话不对吗,应该怎么写?

jhlcss 2003-09-12 02:39:15
谢谢
...全文
69 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
yewei4u 2003-09-12
  • 打赏
  • 举报
回复
string [] fileEntries = Directory.GetFiles(targetDirectory));
CMIC 2003-09-12
  • 打赏
  • 举报
回复
string[] oFiles=Directory.GetFiles(strPath);
sqhua 2003-09-12
  • 打赏
  • 举报
回复
string [] fileEntries = Directory.GetFiles(targetDirectory);
sqhua 2003-09-12
  • 打赏
  • 举报
回复
string [] fileEntries = Directory.GetFiles(targetDirectory);
速马 2003-09-12
  • 打赏
  • 举报
回复
FileInfo thisFile = new FileInfo(FilePath)
jhlcss 2003-09-12
  • 打赏
  • 举报
回复
那我得到了string类型的字符串,我怎样将其转换为File对象
lyrixliu 2003-09-12
  • 打赏
  • 举报
回复
string [] fileEntries = Directory.GetFiles(strPath);
GetFiles返回的是字符串,不是file对象
jhlcss 2003-09-12
  • 打赏
  • 举报
回复
可是不行啊,无法将类型“string[]”隐式转换为“System.IO.File[]”
wkyjob 2003-09-12
  • 打赏
  • 举报
回复
File[]是什么型呢?
brightheroes 2003-09-12
  • 打赏
  • 举报
回复
应该没有问题,strPath传入的参数正确吗?
Delphi XE HandBook DelphiXE手册 Table Of Contents Introduction....................................................................................... ..............5 About This Book....................................................................................................................5 Source Code.............................................................................................. .......................6 Editor and Tech Review ers............................................................................... ...............7 About Myself ............................................................................................... .................... ......7 Contact Informatio n............................................................................................. ...........8 Table of Co ntents....................................... ......................................................9 Chapter 1: Delphi XE ID E.............................................. ..................................13 Managing Projects...............................................................................................................14 Build Gr oups..................................................................................................................15 The Configuration Manager...................................................................................... .....16 Build Tools Customizatio n.................................................................................. ...........17 Extensions to Searchin g............................................................................................. .........18 Search For Usages...................................................................................................... ....18 Local Search Shor t Cut Ke ys..........................................................................................19 Editor ............................................................................................................. ............ .........20 New Live Temp lates......................................................................... .............................20 XMLDoc Comments and Help Insight................................................................. .........22 Navigating Modified Code................................................................................ .............23 Source Code Fo rmatting ........................................................................................ .............24 Formatter Pr ofiles.................................................................. .......................................25 Marco Cantù, Delphi XE Handbook 10 - Table of Contents Other Changes in Formatti ng........................................................................................26 Form Designer ....................................................................................... ........................... ..26 Updated Wizards....................................................................................... ......................... 28 Install Componen t Wizard .................................................................... ........................28 Web Server Application................................................................................ ......................29 The Deb ugger......................................................................................................................30 Named Threads.................................................................................. ...........................30 Run Without Debugging....................................................... ........................................30 More Debugger Features...............................................................................................31 Chapter 2: Integrat ed Toolin g.........................................................................33 Version Control Integratio n........................................................ .......................................34 Version Control Systems .................................................................. .............................34 Subversi on..................................................................................................................... 36 Subversion in Delphi................................................................................................ ......41 Beyond Compare In tegratio n.................................................................... ....................43 The Updated Hist ory View .................................................................... ........................44 Version Insight and Its Extens ions.................................................. .............................46 UML Modeling ................................................................................................... ................ .47 Classic Live Diagrams: Packages and Cl asses....................................... ........................47 Ancestor Classes in Class Diagrams.................................................................... ..........48 Sequence Diagrams.......................................................................... .............................49 Audits, Metrics, and Documentation from the Co mmand Line...................................50 Third-Party Tools....................................................................................... ....................... ..51 CodeSite................................................................................ ....................................... ..51 AQTime......................................................................................................................... .54 FinalBui lder ................................................................................................................... 55 Chapter 3: Compi ler and RTL.........................................................................59 The Delphi Compiler ..........................................................................................................60 Different Defaults, Different Re sult................................................................ ..............60 No More String Checks .......................................................... .......................................60 New Alignments................................................................................................ .............61 RTTI and Virtual Methods Interceptors........................................ ...............................62 The Run Time Library................................................................. .......................................66 Dates and Files................................................................. .............................................67 Splitting St rings.................................................................................................... .........68 Command Line Parsing.................................................................................... .............68 GUID Help er.................................................................................................................69 Marco Cantù, Delphi XE Handbook Table of Contents - 11 Number of CPU Cores.................................................................. .................................70 Binary Reader and Writ er..................................................................................................70 Regular Expression s...........................................................................................................7 3 A Regular Expressions Primer.......................................................................................73 Regular Expressions in Delphi XE...................................... ..........................................75 The RegExPrimer Example ...........................................................................................76 Threading and Sync hronization.........................................................................................80 Anonymous Th reads...................................................................... ...............................80 Waiting, While Ke eping Bu sy................................................................................ ........84 Using a SpinWait...........................................................................................................86 A Thread-Safe Queue .................................................................. ..................................88 Chapter 4: XE Libraries..................................................................................91 Minor VCL Changes.......................................................................... ..................................91 JSON Processing................................................................................................................ .92 JSON Parsing Cleaned Up.............................................................................................92 Google Translate Revisited............................................................................................94 JSON and Ta bles................................................................................. ..........................96 JSON Marshaling..........................................................................................................97 XML Processing ................................................................................................ ................1 00 WebBroker and Indy Web Servers ...................................................................................102 Building a Sample Serv er................................................... .........................................104 SOAP Improvements..................................................................... ...................................109 Microsoft's Azure Native Support....................................................................................109 Delphi XE Components for Azure................................................................................110 The Azure101 Demo .................................................................................... ..................111 The Azure Publish and Consume Demo......................................................................116 Amazon Web Servic es and Mo re.............................................................. ...................120 Epilogue................................................................................................... .....123 DataSnap White Papers ........................................................................ .......................123 Everything XE Demo ................................................................. ..................................124 More Books Coming..........................................................................................................125 Index ....................................................................................................... ......127
文件管理 一、实验目的: 1.了解os中文件的组织和管理。 2.熟悉文件中所用的数据结构。 二、实验要求: 1. 设计一个N个用户的文件系统,每个用户最多保存m个文件。 2. 限制用户在一次使用中只能打开L个文件。 3. 系统应能检查输入命令的正确性,出错能显示出原因。 4. 对文件必须设置保护措施,如只读、、执行等。在每次打开时再次设置保护级别,即 可有二级保护。 5. 对文件的操作至少有以下几条命令 create:建文件 delete:删文件 open:打开文件 close:关闭文件 read:读文件 write:文件 举例:主文件目录 mfd=record username :string[maxlen]; files :array[1..L] of ufd; ofiles :arrau[1..S] of uod end; 用户打开文件目录表: uod=record filename:string[maxlen]; attrib:attrib; len:integer; status:(open,create); rp,up:integer; end; 用户文件目录: ufd=record fielname:string[maxlen]; attribΛro,rw); len:integer; addr:integer; end; 流程图: 开始 输入用户名 在MFD中找到该用户名 显示该用户名UFD中所有文件 初始化AFD 操作 命令 CREATE DELTET OPEN CLOSE READ WRITE 保护当前文件目录 结束 二、主要数据结构 界面采用VC6 MFC环境开发 #define MAXFILE 20 //每个用户最多保存20个文件 #define MAXUSER 10 //假想文件系统最多支持的人数 #define BLOCKSIZE 32 //虚拟磁盘中物理块为每块32字节 #define DISKSIZE BLOCKSIZE*1000 //虚拟磁盘容量为1000*32=32K struct UFD //说明文件项的结构数组 { char FileName[15]; char Time[16]; //文件建立或修改时间 如2003/5/6 12:00 bool IsExist; //文件是否存在,删除时标为0 bool IsShared; //共享标记,共享文件可被其它用户所访问 bool AttrRead; //文件是否可读 bool AttrWrite; //文件是否可 bool AttrExecute; //文件是否可执行 HTREEITEM treeNode; //用于树控件显示的结点句柄 USHORT FileLen; //文件占用字节数 USHORT BlockNum; //文件占用的物理块数 USHORT FileLink[100];//文件物理块地址数组,每块32字节,限定一个文件最大100*32=3200字 节 }; struct MFD { char UserName[10]; //主目录用户名 bool IsExist; //该用户否存在 UFD ufd[MAXFILE]; //用户文件数组 USHORT nItem;//UFD个数 }; struct HEADBLOCK { BYTE pStack; //堆栈指针 SHORT pBlock[10]; //块号 pBlock[10]是下一个盘块号逻辑地址 }; struct BLOCK //虚拟磁盘的物理块数据结构 { union{ BYTE block[32];        //一块为32字节 HEADBLOCK HeadInfo; }; }; struct FAT { BLOCK SuperBlock; //超级块,指示第一个空闲块逻辑号 USHORT MaxOpen; //该用户同时可打开的最大文件数 USHORT UserNum; //最户数 MFD Mfd[MAXUSER]; //最多可支持10个用户 }; //空闲块成组链接法 bool OpenList[MAXUSER][MAXFILE]; //描述文件是否打开的布尔型数组 FAT FileFAT;           //描述文件记录项的FAT结构 CFile FATIO; //负责和VDISK.DAT打交道的文件句柄 CString CurrentUser; //当前登录的用户名 Int CurrentID; //前前登录的用户标识号 说明:本实验采用模拟文件结构的方法,把记录用户帐号,用户文件和磁盘块的信息 用当前目录下的VDISK.DAT来记录,可以把VDISK.DAT看成是一个虚拟的磁盘,其头部是 FAT结构,用来记录各个用户和文件信息,紧接着是空闲

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧