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




  • 相关阅读:
    Extension:WYSIWYG
    partprobe
    Centos install Parosid
    linux 打造man中文帮助手册图解
    男人到了二十几岁后
    Mediawiki update to 1.24
    华为笔试题
    排序算法
    求素质的算法
    判断有符号和无符号数和符号
  • 原文地址:https://www.cnblogs.com/cy163/p/506437.html
Copyright © 2011-2022 走看看