{"id":67,"date":"2008-12-24T15:07:10","date_gmt":"2008-12-24T15:07:10","guid":{"rendered":"http:\/\/kumouse.aafox.com\/?p=67"},"modified":"2008-12-24T15:07:10","modified_gmt":"2008-12-24T15:07:10","slug":"windows-%e6%96%87%e4%bb%b6%e6%93%8d%e4%bd%9c-%e6%9f%a5%e6%89%be%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.kumouse.com\/?p=67","title":{"rendered":"Windows \u6587\u4ef6\u64cd\u4f5c \u2014 \u67e5\u627e\u6587\u4ef6"},"content":{"rendered":"<p>\u5f00\u59cb\u67e5\u627e\u6587\u4ef6,\u9996\u5148\u4f7f\u7528FindFirstFile\u51fd\u6570,\u5982\u679c\u51fd\u6570\u6267\u884c\u6210\u529f,\u8fd4\u56de\u4e00\u4e2a\u53e5\u67c4hFindFile\u6765\u5bf9\u5e94\u8fd9\u4e2a\u5bfb\u627e\u64cd\u4f5c,\u63a5\u4e0b\u6765\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u53e5\u67c4\u5faa\u73af\u8c03\u7528FindNextFile\u7ee7\u7eed\u67e5\u627e\u5176\u5b83\u6587\u4ef6,\u76f4\u5230FindNextFile\u8fd4\u56de\u5931\u8d25\u4e3a\u6b62.\u6700\u540e\u5173\u95edhFindFile\u53e5\u67c4.\u4e00\u822c\u67e5\u627e\u6587\u4ef6\u7684\u4ee3\u7801\u7ed3\u6784:<\/p>\n<blockquote><p>invoke FindFirstFile,lpFindFile,lpFindFileDate<br \/>.if eax != INVALID_HANDLE_VALUE<br \/>   mov hFindFile,eax<br \/>   .repeat<br \/>            ;\u5904\u7406\u672c\u6b21\u627e\u5230\u7684\u6587\u4ef6<br \/>            invoke FindNextFile,hFindFile,addr lpFindFileData<br \/>   .until eax==FALSE<br \/>   invoke FindClose,hFindFile<br \/>.endif<\/p><\/blockquote>\n<p>FindFirstFile\u7684\u53c2\u6570lpFindFile\u6307\u5411\u4e00\u4e2a\u5b57\u7b26\u4e32,\u4ee3\u8868\u8981\u5bfb\u627e\u7684\u6587\u4ef6\u540d,\u5982\u679c\u6587\u4ef6\u540d\u4e2d\u4e0d\u952f\u542b\u8def\u5f84,\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e2d\u67e5\u627e\u6587\u4ef6.\u5728\u6587\u4ef6\u540d\u4e2d\u53ef\u4ee5\u5305\u542b&#39;*&#39;\u6216&#39;?&#39;\u901a\u914d\u7b26<br \/>FindFirstFile\u51fd\u6570\u548cFindNextFile\u51fd\u6570\u4e2d\u7684lpFindFileData\u53c2\u6570\u5219\u6307\u5411\u4e00\u4e2a\u7f13\u51b2\u533a,\u51fd\u6570\u4f1a\u5728\u7f13\u51b2\u533a\u4e2d\u8fd4\u56de\u4e00\u4e2aWIN_FIND_DATA\u7ed3\u6784,\u7ed3\u6784\u4e2d\u5305\u62ec\u4e86Windows\u67e5\u627e\u8fc7\u7a0b\u4e2d\u4e34\u65f6\u4f7f\u7528\u7684\u6570\u636e\u548c\u627e\u5230\u7684\u6587\u4ef6\u540d\u4e0e\u5c5e\u6027\u7b49\u6570\u636e,\u8be5\u7ed3\u6784\u5b9a\u4e49\u5982\u4e0b:<\/p>\n<blockquote><p>WIN32_FIND_DATA STRUCT<br \/>dwFileAttributes    DWORD ?                       ;\u6587\u4ef6\u5c5e\u6027<br \/>ftCreationTime      FILETIME  &lt;&gt;                 ;\u6587\u4ef6\u7684\u521b\u5efa\u65e5\u671f<br \/>ftLastAccessTime   FILETIME &lt;&gt;                  ;\u6587\u4ef6\u7684\u6700\u540e\u5b58\u53d6\u65e5\u671f<br \/>ftlastWriteTime     FILETIME  &lt;&gt;                  ;\u6587\u4ef6\u7684\u6700\u540e\u4fee\u6539\u65e5\u671f<br \/>nFileSizeHigh         DWORD ?                        ;\u6587\u4ef6\u957f\u5ea6\u7684\u9ad832\u4f4d<br \/>nFileSizeLow         DWORD ?                        ;\u6587\u4ef6\u957f\u5ea6\u7684\u4f4e32\u4f4d<br \/>dwReserved0       DWORD ?                        ;\u5185\u90e8\u4f7f\u7528<br \/>dwReserved1       DWORD ?                        ;\u5185\u90e8\u4f7f\u7528<br \/>cFileName            BYTE MAX_PATH dup(?)   ;\u672c\u6b21\u627e\u5230\u7684\u6587\u4ef6\u540d<br \/>cAlternate           BYTE 14 dup(?)               ;\u6587\u4ef6\u76848.3\u7ed3\u6784\u7684\u77ed\u6587\u4ef6\u540d<br \/>WIN32_FIND_DATA ENDS<\/p><\/blockquote>\n<p>dwFileAttributes\u5b57\u6bb5\u53ef\u4ee5\u662f\u4e0b\u9762\u53d6\u503c\u7684\u7ec4\u5408,\u901a\u8fc7\u5b83\u53ef\u4ee5\u68c0\u67e5\u627e\u5230\u7684\u662f\u4e00\u4e2a\u6587\u4ef6\u8fd8\u662f\u4e00\u4e2a\u5b50\u76ee\u5f55,\u4ee5\u53ca\u5c5e\u6027<br \/>FILE_ATTRIBUTE_ARCHIVE:\u6587\u4ef6\u5305\u542b\u5f52\u6863\u5c5e\u6027<br \/>FILE_ATTRIBUTE_COMPRESSED:\u6587\u4ef6\u548c\u76ee\u5f55\u88ab\u538b\u7f29<br \/>FILE_ATTRIBUTE_DIRECTORY:\u627e\u5230\u7684\u662f\u4e00\u4e2a\u76ee\u5f55<br \/>FILE_ATTRIBUTE_HIDDEN:\u6587\u4ef6\u5305\u542b\u9690\u542b\u5c5e\u6027<br \/>FILE_ATTRIBUTE_NORMAL:\u6587\u4ef6\u6ca1\u6709\u5176\u5b83\u5c5e\u6027<br \/>FILE_ATTRIBUTE_READONLY:\u6587\u4ef6\u5305\u542b\u53ea\u8bfb\u5c5e\u6027<br \/>FILE_ATTRIBUTE_SYSTEM:\u6587\u4ef6\u5305\u542b\u7cfb\u7edf\u5c5e\u6027<br \/>FILE_ATTRIBUTE_TEMPORARY:\u6587\u4ef6\u662f\u4e00\u4e2a\u4e34\u65f6\u6587\u4ef6<br \/><span style=\"color:Red\">\u6ce8\u610f:cFileName\u5b57\u6bb5\u4e2d\u5305\u62ec\u4e86\u627e\u5230\u7684\u6587\u4ef6\u540d,\u8fd9\u4e2a\u6587\u4ef6\u540d\u4e2d\u5e76\u4e0d\u5305\u542b\u8def\u5f84.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f00\u59cb\u67e5\u627e\u6587\u4ef6,\u9996\u5148\u4f7f\u7528FindFirstFile\u51fd\u6570,\u5982\u679c\u51fd\u6570\u6267\u884c\u6210\u529f,\u8fd4\u56de\u4e00\u4e2a\u53e5\u67c4hFindFile\u6765\u5bf9\u5e94\u8fd9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-12"],"_links":{"self":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":0,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}