{"id":872,"date":"2013-05-11T19:22:14","date_gmt":"2013-05-11T11:22:14","guid":{"rendered":"http:\/\/www.shizhiyou.com\/blog\/?p=872"},"modified":"2013-05-12T16:30:31","modified_gmt":"2013-05-12T08:30:31","slug":"vc-mfc-%e4%b8%8b%e5%a6%82%e4%bd%95%e6%9f%a5%e6%89%be%e6%9f%90%e4%b8%80%e4%b8%aa%e6%96%87%e4%bb%b6%e5%a4%b9%e4%b8%8b%e7%9a%84%e6%9c%ab%e4%b8%80%e7%b1%bb%e5%9e%8b%e7%9a%84%e6%96%87%e4%bb%b6-%e5%87%bd","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/872","title":{"rendered":"vc++ -mfc \u4e0b\u5982\u4f55\u67e5\u627e\u67d0\u4e00\u4e2a\u6587\u4ef6\u5939\u4e0b\u7684\u672b\u4e00\u7c7b\u578b\u7684\u6587\u4ef6 \u51fd\u6570"},"content":{"rendered":"

\u8fd8\u662f\u8fd4\u56de\u4e00\u4e2aCStringarray \u5bf9\u8c61\u5427\u3002ok\uff0chere we go :<\/p>\n

void filefind(CString strdir,CString strtype,CStringArray * arrreturn)\/\/strdir\u4e3a\u6307\u5b9a\u6587\u4ef6\u5939,strtype\u4e3a\u6307\u5b9a\u7c7b\u578b,
\n{
\n\/\/arrreturn = new CStringArray;
\nCStringArray arr;<\/p>\n

CFileFind finder; \/\/\u6587\u4ef6\u67e5\u627e\u7c7b
\nCString filedir,filename,str;
\n\/\/str = L”D:\\\\\u6211\u7684\u6587\u6863\\\\Visual Studio 2010\\\\Projects\\\\MZY\\\\MZY\\\\pics”;
\nfiledir=strdir+”\\\\*”+strtype;
\nBOOL b_finded=(BOOL)finder.FindFile(filedir);<\/p>\n

int i=0;
\nwhile(b_finded)
\n{<\/p>\n

i++;
\nb_finded=(BOOL)finder.FindNextFile();<\/p>\n

filename=finder.GetFileName(); \/\/\u83b7\u53d6\u627e\u5230\u7684\u6587\u4ef6\u540d
\narr.Add(filename);
\n}
\nfinder.Close();
\nfor (int j=0;j<arr.GetCount();j++)
\n{
\n\/\/AfxMessageBox(arr[j]);
\narrreturn->Add(arr[j]);
\n}
\n\/\/arrreturn = arr;
\n\/\/return i;
\n\/\/return arrreturn;
\n}<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u8fd8\u662f\u8fd4\u56de\u4e00\u4e2aCStringarray \u5bf9\u8c61\u5427\u3002ok\uff0chere we go : void filefind(CString strdir,CString strtype,CStringArray * arrreturn)\/\/strdir\u4e3a\u6307\u5b9a\u6587\u4ef6\u5939,strtype\u4e3a\u6307\u5b9a\u7c7b\u578b, { \/\/arrreturn = new CStringArray; CStringArray arr; CFileFind finder; \/\/\u6587\u4ef6\u67e5\u627e\u7c7b CString filedir,filename,str; \/\/str = L”D:\\\\\u6211\u7684\u6587\u6863\\\\Visual Studio 2010\\\\Projects<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,9],"tags":[],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/872"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=872"}],"version-history":[{"count":4,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/872\/revisions"}],"predecessor-version":[{"id":877,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/872\/revisions\/877"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=872"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}