社区
C#
帖子详情
File[] oFiles=Directory.GetFiles(strPath);这句话不对吗,应该怎么写?
jhlcss
2003-09-12 02:39:15
谢谢
...全文
69
10
打赏
收藏
File[] oFiles=Directory.GetFiles(strPath);这句话不对吗,应该怎么写?
谢谢
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用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手册
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 o
file
s
.................................................................. .......................................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
Str
ing Checks .......................................................... .......................................60 New Alignments................................................................................................ .............61 RTTI and Virtual Methods Interceptors........................................ ...............................62 The Run Time Library................................................................. .......................................66 Dates and
File
s
................................................................. .............................................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
文件管理实验报告.doc
文件管理 一、实验目的: 1.了解os中文件的组织和管理。 2.熟悉文件中所用的数据结构。 二、实验要求: 1. 设计一个N个用户的文件系统,每个用户最多保存m个文件。 2. 限制用户在一次使用中只能打开L个文件。 3. 系统应能检查输入命令的正确性,出错能显示出原因。 4. 对文件必须设置保护措施,如只读、
写
、执行等。在每次打开时再次设置保护级别,即 可有二级保护。 5. 对文件的操作至少有以下几条命令 create:建文件 delete:删文件 open:打开文件 close:关闭文件 read:读文件 write:
写
文件 举例:主文件目录 mfd=record username :
str
ing[maxlen];
file
s
:array[1..L] of ufd; o
file
s
:arrau[1..S] of uod end; 用户打开文件目录表: uod=record
file
name:
str
ing[maxlen]; attrib:attrib; len:integer; status:(open,create); rp,up:integer; end; 用户文件目录: ufd=record fielname:
str
ing[maxlen]; attribΛro,rw); len:integer; addr:integer; end; 流程图: 开始 输入用户名 在MFD中找到该用户名 显示该用户名UFD中所有文件 初始化AFD 操作 命令 CREATE DELTET OPEN CLOSE READ WRITE 保护当前文件目录 结束 二、主要数据结构 界面采用VC6 MFC环境开发 #define MAX
FILE
20 //每个用户最多保存20个文件 #define MAXUSER 10 //假想文件系统最多支持的人数 #define BLOCKSIZE 32 //虚拟磁盘中物理块为每块32字节 #define DISKSIZE BLOCKSIZE*1000 //虚拟磁盘容量为1000*32=32K
str
uct UFD //说明文件项的结构数组 { char
File
Name[15]; char Time[16]; //文件建立或修改时间 如2003/5/6 12:00 bool IsExist; //文件是否存在,删除时标为0 bool IsShared; //共享标记,共享文件可被其它用户所访问 bool AttrRead; //文件是否可读 bool AttrWrite; //文件是否可
写
bool AttrExecute; //文件是否可执行 HTREEITEM treeNode; //用于树控件显示的结点句柄 USHORT
File
Len; //文件占用字节数 USHORT BlockNum; //文件占用的物理块数 USHORT
File
Link[100];//文件物理块地址数组,每块32字节,限定一个文件最大100*32=3200字 节 };
str
uct MFD { char UserName[10]; //主目录用户名 bool IsExist; //该用户否存在 UFD ufd[MAX
FILE
]; //用户文件数组 USHORT nItem;//UFD个数 };
str
uct HEADBLOCK { BYTE pStack; //堆栈指针 SHORT pBlock[10]; //块号 pBlock[10]是下一个盘块号逻辑地址 };
str
uct BLOCK //虚拟磁盘的物理块数据结构 { union{ BYTE block[32]; //一块为32字节 HEADBLOCK HeadInfo; }; };
str
uct FAT { BLOCK SuperBlock; //超级块,指示第一个空闲块逻辑号 USHORT MaxOpen; //该用户同时可打开的最大文件数 USHORT UserNum; //最户数 MFD Mfd[MAXUSER]; //最多可支持10个用户 }; //空闲块成组链接法 bool OpenList[MAXUSER][MAX
FILE
]; //描述文件是否打开的布尔型数组 FAT
File
FAT; //描述文件记录项的FAT结构 C
File
FATIO; //负责和VDISK.DAT打交道的文件句柄 C
Str
ing CurrentUser; //当前登录的用户名 Int CurrentID; //前前登录的用户标识号 说明:本实验采用模拟文件结构的方法,把记录用户帐号,用户文件和磁盘块的信息 用当前目录下的VDISK.DAT来记录,可以把VDISK.DAT看成是一个虚拟的磁盘,其头部是 FAT结构,用来记录各个用户和文件信息,紧接着是空闲
KernInfra是开发人员友好的内核读
写
框架。-C/C++开发
KernInfra是开发人员友好的内核读
写
框架。 KernInfra KernInfra是开发人员友好的内核读
写
框架。 为什么创建KernInfra KernInfra是为了解决以下工程问题:内核链RW问题:用于vnode_from_fd = proc_t-> p_fd-> fd_o
file
s
[0]-> f_fglob-> fg_data PAC指针处理:大量的kxpacd调用内核读取地址检查:不再需要内核数据中止内核偏移管理:不再需要off_XXX_YYY多个内核R / W提供程序:现在是2021年,再见了tfp0,并且您好libkrw / libkernrw各种各样
遍历文件夹下文件
写
入文本
set f=ofso.opentext
file
("D:\print.txt",2,true) f.write a f.close msgbox "完成。" Function TreeIt(s
Path
) on error resume next Set oFso = CreateObject("Scripting.
File
S
ystemObject") Set oFolder =
遍历IIS日志文件夹下的所有文件及子文件夹下的文件
if date-oDate > KeepDays then o
File
.delete '判断是不是要处理的IIS日志文件,如果是的
话
直接删除。Set oSubFolders = oFolder.SubFolders '得到该目录下所有的文件夹的集合。Set o
File
s
= oFolder.
File
s
'得到该目录下所有的文件的集合。'遍历IIS日志文件夹下的所有文件及子文件夹下的文件。'第二步处理当前目录下的所有目录,进行递归调用。'第一步处理当前目录下的所有文件。
C#
110,534
社区成员
642,575
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章