用CFile类的GetStatus()成员函数就可以了

解决方案 »

  1.   

    struct stat buffer;
    int handle;
    if(handle-open("myfile",0_RDONLY)==-1)
    //do something error
    else
    { if(fstat(handle,&buffer)
        //error do something
      else 
        printf("myfile is %ld bytes,last used %s\n",buffer.zt_size,ctime(&buffer.st_atime));
    close(handle);
    }
    #include "io.h"
    "fcntl.h"
    "sys\stat.h"
    "time.h"
      

  2.   

    BOOL GetFileInformationByHandle(
      HANDLE hFile,                                  // handle to file 
      LPBY_HANDLE_FILE_INFORMATION lpFileInformation // buffer
    );
      

  3.   

    假设有一C:\WIN.BMP文件,谁能给出源代码
      

  4.   

    我使用了CFile类的GetStatus,可是无论如何也读不出来属性,不知道这到底是为什么
      

  5.   

    CFileStatus status;
    CFile m_File;
    if(m_File.GetStatus("c:\\1.txt", status))
    {
       /*从status的m_attribute中得到文件的各种属性
                   normal =    0x00,
                   readOnly =  0x01,
                   hidden =    0x02,
                   system =    0x04,
                   volume =    0x08,
                   directory = 0x10,
                   archive =   0x20
                 */
    }