在VC中,如何修改文件的只读属性设置
static char BASED_CODE szFilter[] = "*.ppt"; CFileDialog FileDlg(TRUE,"PPT",NULL,OFN_FILEMUSTEXIST|OFN_NONETWORKBUTTON |OFN_PATHMUSTEXIST,szFilter); FileDlg.DoModal(); // To get the selected file's path and name CString strFileName; strFileName = FileDlg.GetPathName(); //-------------------将只读文件的只读属性去掉----------------------- CFileStatus rStatus; CFile::GetStatus(strFileName,rStatus);//获得文件的属性设置 rStatus.m_attribute=rStatus.m_attribute & 0x3E ; //如果文件为只读的,将只读属性去掉 //-------------------------------------------- CFile::SetStatus(strFileName, rStatus );//更改文件的属性设置 …… } enum Attribute { normal = 0x00