社区
C++ Builder
帖子详情
我想查找指定目录的某类型文件并加入列表,是不是用FindFirst什么的?但是看不动struct _wffblk 。。。
CPerlAsm_Lx
2003-09-15 12:51:03
我想查找指定目录的某类型文件并加入列表,是不是用FindFirst什么的?但是看不动struct _wffblk 。。。什么的,不知道怎么用?
另外,如何熟悉这些函数让自己也知道什么时候去找什么函数呢。。感觉好多东西,也没有资料看。。
...全文
129
8
打赏
收藏
我想查找指定目录的某类型文件并加入列表,是不是用FindFirst什么的?但是看不动struct _wffblk 。。。
我想查找指定目录的某类型文件并加入列表,是不是用FindFirst什么的?但是看不动struct _wffblk 。。。什么的,不知道怎么用? 另外,如何熟悉这些函数让自己也知道什么时候去找什么函数呢。。感觉好多东西,也没有资料看。。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
tccsdn
2003-09-15
打赏
举报
回复
TSearchRec sc;
if( FindFirst(SongPathEdit->Text+"*.*", faAnyFile, sc )==0 )
{
do
{
if( !(sc.Attr & faDirectory ) &&
(ExtractFileExt(SongPathEdit->Text+sc.Name)==".mpg")||
(ExtractFileExt(SongPathEdit->Text+sc.Name)==".MPG")||
(ExtractFileExt(SongPathEdit->Text+sc.Name)==".dat")||
(ExtractFileExt(SongPathEdit->Text+sc.Name)==".DAT") )
{
}
}while (FindNext(sc)==0 );
FindClose(sc);
}
改动一点就可以用了
CPerlAsm_Lx
2003-09-15
打赏
举报
回复
我当然知道BIT,是我不小心误解bit fields的意思了。。。
netsys2
2003-09-15
打赏
举报
回复
你的英语还没过2级吧?
f_ftime and ff_fdate contain bit fields for referring to the current date and time.
f_ftime 和 ff_fdate包含按bit分割的时间和日期。
(你如果不知道bit,你就别编程了)
The structure of these fields was established by the operating system.
这些结构都是操作系统建立的
Both are 16-bit structures divided into three fields.
都是16bit分割的域
ff_ftime:
Bits 0 to 4 The result of seconds divided by 2 (for example 10 here means 20 seconds)
从0~4bit:秒数除2的 结果,例如,数据是10代表20秒
Bits 5 to 10 Minutes
5~10bit:分钟
Bits 11 to 15 Hours
11~15bit:小时
ff_fdate:
Bits 0-4 Day
Bits 5-8 Month
Bits 9-15 Years since 1980 (for example 9 here means 1989)
从1980年起的年数,例如数据为9,就是1980+9=1989年
weixing979
2003-09-15
打赏
举报
回复
AnsiString dir;
TSearchRec SearchRec;
SelectDirectory ("请选择一个文件夹","",dir); //浏览文件夹
if( FindFirst(dir+"\\*.txt",faAnyFile,SearchRec)==0) // 查找第一个txt文件
ListBox->Items->Add(dir+"\\"+SearchRec.Name);
while (FindNext(SearchRec)==0)
ListBox->Items->Add(dir+"\\"+SearchRec.Name);
FindClose(SearchRec);
在指定目录下查找txt文件,并填加到ListBox中
weixing979
2003-09-15
打赏
举报
回复
AnsiString dir;
TSearchRec SearchRec;
SelectDirectory ("请选择一个文件夹","",dir); //浏览文件夹
if( FindFirst(dir+"\\*.txt",faAnyFile,SearchRec)==0) // 查找第一个txt文件
ListBox->Items->Add(dir+"\\"+SearchRec.Name);
while (FindNext(SearchRec)==0)
ListBox->Items->Add(dir+"\\"+SearchRec.Name);
FindClose(SearchRec);
在指定目录上查找txt文件,并填加到listbox中
CPerlAsm_Lx
2003-09-15
打赏
举报
回复
netsys2(来电) 跟你去看了一趟,不过我的英语还不怎么好。加强中。。。
哟没有能稍微翻译一下的
ff_ftime and ff_fdate contain bit fields for referring to the current date and time.
bit fields ????不懂!
zihan
2003-09-15
打赏
举报
回复
void __fastcall TForm1::RecursionFiles(AnsiString Path)
{
TSearchRec sr;
if(FindFirst(Path+"\\*.txt",faAnyFile,sr)==0)
{
do{
FileList->Add(Path+sr.Name);
} while (FindNext(sr) == 0);
FindClose(sr);
}
}
netsys2
2003-09-15
打赏
举报
回复
跟我来:
CB菜单--》Help-->C++ Builder Help
输入关键词:
findfirst
选择第二项:
findfirst,_wfindfirst
出来一大篇东西,慢慢看:
Examples:
/* findfirst and findnext example */
#include <stdio.h>
#include <dir.h>
int main(void)
{
struct ffblk ffblk;
int done;
printf("Directory listing of *.*\n");
done = findfirst("*.*",&ffblk,0);
while (!done)
{
printf(" %s\n", ffblk.ff_name);
done = findnext(&ffblk);
}
return 0;
}
Go语言官方文档学习笔记(第五季)
1-
Struct
s 2-
Struct
Fields 3-Pointers to
struct
s 4-
Struct
Literals 5-Arrays 6-Slices 7-Slices are like references to arrays 8-Slice literals 9-Slice defaults 10-Slice length and capacity 课程
目录
goweb网站博客与定时任务系统实战
Go语言性能好、语法简单、开发效率高!一起来探索Go ...index.tpl 从上面的
目录
结构我们可以看出来 M(models
目录
)、V(views
目录
)和 C(controllers
目录
)的结构, main.go 是入口
文件
。
OpenGL-自主高性能三维GIS平台架构与实现-第二季
根据使用目的不同,介绍多种优化方法 3 DEM图层的实现原理 1 4 DEM数据结构定义
struct
V3U3N4{float x, y, z;float u, v, w;byte nx,ny,nz,nw;}顶点数据的生成和...
C++零基础入门(C++11/C++14)
课程系统且全面,理论与代码结合, 每节课程都会用最简洁的代码讲解对应C++语法点,同时每节课还配了高清字幕,非常通 俗易懂。课程共分为三篇: 1) 基础篇: 这部分主要学习零散的基础语法,比如变量、常量、运算符...
GORM从入门到进阶
Gorm 是当今比较热门的 Golang 的 ORM 操作数据库的工具,使用上主要是把
struct
类和数据库表进行映射,操作数据库时无需手写SQL。 本套课程将带你了解什么是GORM,如何快速使用GORM,如何使用GORM高级用法 ...
C++ Builder
13,825
社区成员
102,679
社区内容
发帖
与我相关
我的任务
C++ Builder
C++ Builder相关内容讨论区
复制链接
扫一扫
分享
社区描述
C++ Builder相关内容讨论区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章