zoukankan      html  css  js  c++  java
  • Visual C the best way to get the contents of a file directory into a list

    http://www.codecomments.com/archive371-2006-2-825947.html

    Author How to get a list of files in a directory??
    aoie

    2006-02-28, 7:59 am

    What is the best way to get the contents of a file directory into a list?


    Bruno van Dooren

    2006-02-28, 7:59 am


    > What is the best way to get the contents of a file directory into a list?


    The easiest is if you can use the .NET framework. Then you can use the
    DirectoryInfo class, which can directly give you an array of contents.

    with win32 you can use the FindFirstFile/FindNextFile enumeration functions.

    For MFC CFindFile is maybe a good solution.

    --

    Kind regards,
    Bruno.
    bruno_nos_pam_van_dooren@hotmail.com
    Remove only "_nos_pam"

    adebaene@club-internet.fr

    2006-02-28, 7:59 am


    aoie wrote:
    > What is the best way to get the contents of a file directory into a list?


    FindFirstFile("*.*")
    FindNextFile
    FindClose

    and filter out "." and ".." entries which, most of the time, are of no
    interest for you.

    Arnaud
    MVP - VC

    adebaene@club-internet.fr

    2006-02-28, 7:59 am


    aoie wrote:
    > What is the best way to get the contents of a file directory into a list?


    FindFirstFile("*.*")
    FindNextFile
    FindClose

    and filter out "." and ".." entries which, most of the time, are of no
    interest for you.

    Arnaud
    MVP - VC

    James Brown [MVP]

    2006-02-28, 7:59 am


    "aoie" <removethis4spam.rastacey@nl.rogers.com> wrote in message
    news:du193k$6g6$1@emma.aioe.org...
    > What is the best way to get the contents of a file directory into a list?
    >
    >


    Take a look at the DlgDirList API

    James

    --
    Microsoft MVP - Windows SDK
    www.catch22.net
    Free Win32 Source and Tutorials


    David D

    2006-02-28, 7:07 pm

    aoie wrote:
    > What is the best way to get the contents of a file directory into a list?
    >
    >


    For a platform independence take a look at Boost and it's Filesystem Library:
    http://www.boost.org/libs/filesystem/doc/index.htm

    /David
    Sponsored Links




  • 相关阅读:
    HDU
    纯C++去雾算法
    拓扑排序
    SG 函数初步 HDU 1536 &amp;&amp; HDU 1944
    <html>
    XML制作RSS源
    ACM退役前2个月总结
    javascript 的 jasmine 的測试语句
    Vue.js父与子组件之间传参
    $.contents().find设置的data在iframe子页面无法获取值
  • 原文地址:https://www.cnblogs.com/cy163/p/506437.html
Copyright © 2011-2022 走看看