计算机课程设计报告_第1页
计算机课程设计报告_第2页
计算机课程设计报告_第3页
计算机课程设计报告_第4页
计算机课程设计报告_第5页
已阅读5页,还剩26页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃

2、袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇

3、蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂

4、薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆

5、螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀

6、蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅

7、袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂薅肂莄蒅袄肁肄芈螀肀芆蒃螆肀荿莆蚂聿肈薂薈肈膀莅袆肇芃薀螂膆莅莃蚈膅肅薈薄膄膇莁羃膄荿薇衿膃蒂葿螅膂膁蚅蚁螈芄蒈薇螈莆蚃袆螇肆蒆螂袆膈蚁蚇袅芀蒄薃袄蒃芇羂袃膂薃袈袂芅莅螄袂莇薁蚀袁肆莄薆袀腿蕿袅罿芁莂螁羈莃薇蚇羇膃莀蚃羆芅蚆蕿羆莈葿袇羅肇蚄螃羄膀蒇虿肃节蚂 计算机程序设计实践课程设计报告班 级 _计算机0801班 _学 号 _080405008 _姓 名 _秦勇旭 指导教师 _刘嘉敏 _

8、2010 年 6月 8日1课题要求及目标基本要求1,实现计算机的各个驱动器中的文件的分类,类别有:文档文件(doc),文本文档(txt),位图文档(bmp,jpg),音频文件(mp3);2,现实每类文件的属性,即文件名(filename),存放位置(address),文件大小(filesize)和创建时间(createtime);3,实现文件的重命名(rename),拷贝(copy),删除(delete)和移动(move)操作;4,实现浏览文本文件,现实位图文件和试听音频文件。开发目标(已完成)1,实现计算机的各个驱动器中的文件的分类,类别有:文档文件(doc),文本文档(txt),位图文档(

9、bmp,jpg),音频文件(mp3);2,现实每类文件的属性,即文件名(filename),存放位置(address),文件大小(filesize)和创建时间(createtime);3,实现文件的重命名(rename),拷贝(copy),删除(delete)和移动(move)操作;4,实现浏览文本文件,现实位图文件和试听音频文件。2用例分析用例模型用例描述:用户对系统文件进行分盘分类查找,实现文件分类查找后的打开播放功能用例1名称用户对程序的应用用例标识号1事件说明:(包括基本、其他、异常事件处理过程)简述: 该用例允许用户对系统文件的分类查找与使用参与者:用户;基本事件:程序运行后,用户是

10、用左视图的tree试图进行事件的触发,单击某一类型的文件,将在右侧的list视图中显示该盘下该文件类型的所有文件用户可以对文件进行处理. 异常处理:关闭。3系统结构设计与实现类图:类名cexplorerdlg, cexplorerapp类的作用实现文件的分类分盘查找,对界面进行初始化类定义:class cexplorerdlg : public cdialog/ constructionpublic:cexplorerdlg(cwnd* pparent = null);/ standard constructor void inittree();char * substr(const char

11、 *s,int sublength, int length);void findfiledoc(char* rootdir);void findfiletxt(char* rootdir);void findfilemp3(char* rootdir);void findfilepic(char* rootdir);/ dialog data/afx_data(cexplorerdlg)enum idd = idd_explorer_dialog ;clistctrlm_list;ctreectrlm_tree;/afx_data/ classwizard generated virtual

12、function overrides/afx_virtual(cexplorerdlg)protected:virtual void dodataexchange(cdataexchange* pdx);/ ddx/ddv support/afx_virtual/ implementationprotected:hicon m_hicon;/ generated message map functions/afx_msg(cexplorerdlg)virtual bool oninitdialog();afx_msg void onsyscommand(uint nid, lparam lpa

13、ram);afx_msg void onpaint();afx_msg hcursor onquerydragicon();afx_msg void onclicktree1(nmhdr* pnmhdr, lresult* presult);afx_msg void onselchangedtree1(nmhdr* pnmhdr, lresult* presult);afx_msg void ondblclklist1(nmhdr* pnmhdr, lresult* presult);/afx_msgdeclare_message_map();类的实现代码(本人实现的部分的代码):void c

14、explorerdlg:inittree()htreeitem h_firstroot; htreeitem h_secondroot4; h_firstroot=m_tree.insertitem(本地计算机,0,1);cstring strsecond4,strthird;h_secondroot0=m_tree.insertitem(c,0,1,h_firstroot);h_secondroot1=m_tree.insertitem(d,0,2,h_firstroot);h_secondroot2=m_tree.insertitem(e,0,3,h_firstroot);for(int

15、i=0;i4;i+) m_tree.insertitem(文档文件,0,1,h_secondrooti);m_tree.insertitem(文本文件,0,2,h_secondrooti);m_tree.insertitem(音频文件,0,3,h_secondrooti);m_tree.insertitem(位图文件,0,4,h_secondrooti);树控件添加节点 bool cexplorerdlg:oninitdialog()cdialog:oninitdialog();/ add about. menu item to system menu./ idm_aboutbox must

16、be in the system command range.assert(idm_aboutbox & 0xfff0) = idm_aboutbox);assert(idm_aboutbox appendmenu(mf_separator);psysmenu-appendmenu(mf_string, idm_aboutbox, straboutmenu);/ set the icon for this dialog. the framework does this automatically/ when the applications main window is not a dialo

17、gseticon(m_hicon, true);/ set big iconseticon(m_hicon, false);/ set small icon/ todo: add extra initialization herem_list.setextendedstyle(lvs_ex_flatsb|lvs_ex_fullrowselect|lvs_ex_headerdragdrop|lvs_ex_oneclickactivate|lvs_ex_gridlines);m_list.insertcolumn(0,filename,lvcfmt_left,120,0);m_list.inser

18、tcolumn(1,address,lvcfmt_left,120,2);m_list.insertcolumn(2,filesize,lvcfmt_left,120,3);m_list.insertcolumn(3,createtime,lvcfmt_left,120,4);初始化list控件,添加文件属性inittree();return true; / return true unless you set the focus to a control4系统行为设计与实现 (与本人相关内容)界面导航关系界面中主要消息响应函数的实现(本人实现的部分的函数)函数名findfiledoc fin

19、dfilemp3findfilepic findfiletxt函数参数char *rootdir函数返回类型void函数实现代码:void cexplorerdlg:findfiledoc(char *rootdir)char fnamemax_path; zeromemory(fname, max_path); win32_find_data fd; zeromemory(&fd, sizeof(win32_find_data); handle hsearch; char filepathname256; char tmppath256; zeromemory(filepathname, 2

20、56); zeromemory(tmppath, 256); strcpy(filepathname, rootdir); bool bsearchfinished = false; if( filepathnamestrlen(filepathname) -1 != ) strcat(filepathname, ); strcat(filepathname, *.*); hsearch = findfirstfile(filepathname, &fd); if( (fd.dwfileattributes & file_attribute_directory) & strcmp(fd.cfi

21、lename, .) & strcmp(fd.cfilename, .) ) strcpy(tmppath, rootdir); strcat(tmppath,); strcat(tmppath, fd.cfilename); findfiledoc(tmppath); 循环调用 else if( strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) sprintf(fname, %-50.50s, fd.cfilename); printf(%sn , fname); while( !bsearchfinished ) if( findnex

22、tfile(hsearch, &fd) ) if( (fd.dwfileattributes & file_attribute_directory) & strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) strcpy(tmppath, rootdir); strcat(tmppath,); strcat(tmppath, fd.cfilename); findfiledoc(tmppath); 循环调用 else if( strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) int n; n

23、=strlen(fd.cfilename);char *sub;sub=substr(fd.cfilename,4,n); if(!strcmp(sub,.doc)文件类型设定 sprintf(fname, %-50.50s, fd.cfilename); cstring sr,strtime,strlast;sr.format(%d,fd.nfilesizelow/1024);ctime strtime=fd.ftcreationtime;ctime strlast=fd.ftlastwritetime;strtime=strtime.format( %y-%m-%d %h:%m:%s );

24、strlast=strlast.format( %y-%m-%d %h:%m:%s ); m_list.insertitem(0,); m_list.setitemtext(0,0,fname);m_list.setitemtext(0,1,filepathname);m_list.setitemtext(0,2,sr+k);m_list.setitemtext(0,3,strtime);m_list.setitemtext(0,4,strlast); else if( getlasterror() = error_no_more_files ) bsearchfinished = true;

25、 else bsearchfinished = true; findclose(hsearch);void cexplorerdlg:findfilemp3(char *rootdir)char fnamemax_path; zeromemory(fname, max_path); win32_find_data fd; zeromemory(&fd, sizeof(win32_find_data); handle hsearch; char filepathname256; char tmppath256; zeromemory(filepathname, 256); zeromemory(

26、tmppath, 256); strcpy(filepathname, rootdir); bool bsearchfinished = false; if( filepathnamestrlen(filepathname) -1 != ) strcat(filepathname, ); strcat(filepathname, *.*); hsearch = findfirstfile(filepathname, &fd); /is directory if( (fd.dwfileattributes & file_attribute_directory) & strcmp(fd.cfile

27、name, .) & strcmp(fd.cfilename, .) ) strcpy(tmppath, rootdir); strcat(tmppath,); strcat(tmppath, fd.cfilename); findfilemp3(tmppath); 循环调用 else if( strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) sprintf(fname, %-50.50s, fd.cfilename); printf(%sn , fname); while( !bsearchfinished ) if( findnextf

28、ile(hsearch, &fd) ) if( (fd.dwfileattributes & file_attribute_directory) & strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) strcpy(tmppath, rootdir); strcat(tmppath,); strcat(tmppath, fd.cfilename); findfilemp3(tmppath); 循环调用 else if( strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) int n; n=s

29、trlen(fd.cfilename);char *sub;sub=substr(fd.cfilename,4,n); if(!strcmp(sub,.mp3)文件类型设定 sprintf(fname, %-50.50s, fd.cfilename); cstring sr,strtime,strlast;sr.format(%d,fd.nfilesizelow/1024);ctime strtime=fd.ftcreationtime;ctime strlast=fd.ftlastwritetime;strtime=strtime.format( %y-%m-%d %h:%m:%s );st

30、rlast=strlast.format( %y-%m-%d %h:%m:%s ); m_list.insertitem(0,); m_list.setitemtext(0,0,fname);m_list.setitemtext(0,1,filepathname);m_list.setitemtext(0,2,sr+k);m_list.setitemtext(0,3,strtime);m_list.setitemtext(0,4,strlast); else if( getlasterror() = error_no_more_files ) bsearchfinished = true; e

31、lse bsearchfinished = true; /terminate search findclose(hsearch);/void cexplorerdlg:findfilepic(char *rootdir)char fnamemax_path; zeromemory(fname, max_path); win32_find_data fd; zeromemory(&fd, sizeof(win32_find_data); handle hsearch; char filepathname256; char tmppath256; zeromemory(filepathname,

32、256); zeromemory(tmppath, 256); strcpy(filepathname, rootdir); bool bsearchfinished = false; if( filepathnamestrlen(filepathname) -1 != ) strcat(filepathname, ); strcat(filepathname, *.*); hsearch = findfirstfile(filepathname, &fd); if( (fd.dwfileattributes & file_attribute_directory) & strcmp(fd.cf

33、ilename, .) & strcmp(fd.cfilename, .) ) strcpy(tmppath, rootdir); strcat(tmppath,); strcat(tmppath, fd.cfilename); findfilepic(tmppath); 循环调用 else if( strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) sprintf(fname, %-50.50s, fd.cfilename); printf(%sn , fname); while( !bsearchfinished ) if( findne

34、xtfile(hsearch, &fd) ) if( (fd.dwfileattributes & file_attribute_directory) & strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) strcpy(tmppath, rootdir); strcat(tmppath,); strcat(tmppath, fd.cfilename); findfilepic(tmppath); 循环调用 else if( strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) int n;

35、n=strlen(fd.cfilename);char *sub;sub=substr(fd.cfilename,4,n); if(!strcmp(sub,.jpg)|!strcmp(sub,.bmp) sprintf(fname, %-50.50s, fd.cfilename); cstring sr,strtime,strlast;sr.format(%d,fd.nfilesizelow/1024);ctime strtime=fd.ftcreationtime;ctime strlast=fd.ftlastwritetime;strtime=strtime.format( %y-%m-%

36、d %h:%m:%s );strlast=strlast.format( %y-%m-%d %h:%m:%s ); m_list.insertitem(0,); m_list.setitemtext(0,0,fname);m_list.setitemtext(0,1,filepathname);m_list.setitemtext(0,2,sr+k);m_list.setitemtext(0,3,strtime);m_list.setitemtext(0,4,strlast); else if( getlasterror() = error_no_more_files ) bsearchfin

37、ished = true; else bsearchfinished = true; findclose(hsearch);void cexplorerdlg:findfiletxt(char *rootdir)char fnamemax_path; zeromemory(fname, max_path); win32_find_data fd; zeromemory(&fd, sizeof(win32_find_data); handle hsearch; char filepathname256; char tmppath256; zeromemory(filepathname, 256)

38、; zeromemory(tmppath, 256); strcpy(filepathname, rootdir); bool bsearchfinished = false; if( filepathnamestrlen(filepathname) -1 != ) strcat(filepathname, ); strcat(filepathname, *.*); hsearch = findfirstfile(filepathname, &fd); if( (fd.dwfileattributes & file_attribute_directory) & strcmp(fd.cfilen

39、ame, .) & strcmp(fd.cfilename, .) ) strcpy(tmppath, rootdir); strcat(tmppath,); strcat(tmppath, fd.cfilename); findfiletxt(tmppath); 循环调用 else if( strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) sprintf(fname, %-50.50s, fd.cfilename); printf(%sn , fname); while( !bsearchfinished ) if( findnextfi

40、le(hsearch, &fd) ) if( (fd.dwfileattributes & file_attribute_directory) & strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) strcpy(tmppath, rootdir); strcat(tmppath,); strcat(tmppath, fd.cfilename); findfiletxt(tmppath);循环调用 else if( strcmp(fd.cfilename, .) & strcmp(fd.cfilename, .) ) int n; n=str

41、len(fd.cfilename);char *sub;sub=substr(fd.cfilename,4,n); if(!strcmp(sub,.txt)文件类型设定 sprintf(fname, %-50.50s, fd.cfilename); cstring sr,strtime,strlast;sr.format(%d,fd.nfilesizelow/1024);ctime strtime=fd.ftcreationtime;ctime strlast=fd.ftlastwritetime;strtime=strtime.format( %y-%m-%d %h:%m:%s );strl

42、ast=strlast.format( %y-%m-%d %h:%m:%s ); m_list.insertitem(0,); m_list.setitemtext(0,0,fname);m_list.setitemtext(0,1,filepathname);m_list.setitemtext(0,2,sr+k);m_list.setitemtext(0,3,strtime);m_list.setitemtext(0,4,strlast); else if( getlasterror() = error_no_more_files ) bsearchfinished = true; els

43、e bsearchfinished = true; findclose(hsearch);函数名:onselchangedtree1函数参数:nmhdr* pnmhdr, lresult* presult函数返回类型:void函数的代码实现:void cexplorerdlg:onselchangedtree1(nmhdr* pnmhdr, lresult* presult) nm_treeview* pnmtreeview = (nm_treeview*)pnmhdr;/ todo: add your control notification handler code herehtreeit

44、em hselecteditem=m_tree.getselecteditem(); htreeitem hparent=m_tree.getparentitem(hselecteditem);cstring str1=m_tree.getitemtext(hparent);cstring m_style; m_style=m_tree.getitemtext(hselecteditem);/文档文件查找 if(m_style=文档文件&str1=d) m_list.deleteallitems(); findfiledoc(d:); if(m_style=文档文件&str1=c) m_list.deleteallitems(); findfiledoc(c:); /文本文件查找 if(m_style=文本文件&str1=c) m_list.deleteallitems(); findfiletxt(c:); if(m_style=文本文件&str1=d) m_list.deleteallitems(); findfiletxt(d:); /音频文件查找 if(m_style=音频文件&str1=d) m_list.deleteallit

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论