zoukankan      html  css  js  c++  java
  • 读取目录中文件名的方法 C++

    以下列出读取目录下所有文件的方法,遇到添加。

    方法1 cmd dir + 读文件  

    在windows命令行中

    dir d:SVNmyWorldVS2019QM_improve4317server /d/w/s/b > filelist.txt

    然后读文件:

    void get_finename() {
        ifstream in;
        in.open("filelist.txt", ios::in);
        if (!in) {
            cout << "open file fail!";
            exit(1);
        }
        else cout << "open file success!" << endl;
        while (!in.eof())
        {
            string temp;
            getline(in, temp, '
    ');//读每行的最后一个会读取到形如
    6B
            cout << temp << endl;
        }
        in.close();
    }
    View Code
  • 相关阅读:
    jQuery-css
    了解jQuery
    jQuery属性
    jQuery常用效果
    jQuery_$工具方法
    jQuery选择器
    jQuery核心对象
    $
    jQuery两把利器
    JavaScriptDOM
  • 原文地址:https://www.cnblogs.com/PiaYie/p/14610028.html
Copyright © 2011-2022 走看看