zoukankan      html  css  js  c++  java
  • WIN32 卷 目录 文件 操作

    //获取卷
        GetLogicalDrives();
        //获取一个卷的盘符的字符串
        GetLogicalDriveStrings();
        //获取卷的类型
        GetDriveType();
        //获取卷的类型
        GetVolumeInformation();


        //创建目录
        CreateDirectory();
        //删除目录
        RemoveDirectory();
        //修改目录名称
        MoveFile();
        //获取程序当前目录
        GetCurrentDirectory();
        //设置程序当前目录
        SetCurrentDirectory();


        //创建文件
        CreateFile();
        //文件的关闭
        CloseHandle(hfile);
        //获取文件大小
        GetFileSize();
        //获取文件属性
        GetFileAttributesEx();

        //读取文件
        //分配空间
        LPSTR pszBuffer = (LPSTR)malloc(10);
        //初始化
        ZeroMemory(pszBuffer, 10);
        //设置当前读取位置
        SetFilePointer(hfile, 1, NULL, FILE_BEGIN);
        //读取数据
        DWORD dwReadLength = 0;
        ReadFile(hfile, pszBuffer, 10, &dwReadLength, NULL);
        printf("%s", pszBuffer);
        //释放内存
        free(pszBuffer);
        //关闭文
        CloseHandle(hfile);

        //写入文件
        //拷贝
        CopyFile();
        //删除文件
        DeleteFile();

        //查找文件
        HANDLE FindFirstFile();

        BOOL FindNextFile();

  • 相关阅读:
    DBUtils温习2
    DBUtils温习1
    C3P0连接池温习1
    JDBC复习2
    JDBC复习1
    Spring的AOP基于AspectJ的注解方式开发3
    Spring的AOP基于AspectJ的注解方式开发2
    Spring的AOP基于AspectJ的注解方式开发1
    高血压认知3
    pandas cookbook
  • 原文地址:https://www.cnblogs.com/ganxiang/p/13111644.html
Copyright © 2011-2022 走看看