CFileDialog( BOOL bOpenFileDialog, LPCTSTR lpszDefExt = NULL, LPCTSTR lpszFileName = NULL, DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter = NULL, CWnd* pParentWnd = NULL );
bOpenFileDialog
Set to TRUE to construct a File Open dialog box or FALSE to construct a File Save As dialog box.
// CFileDialog dlg(false,"TXT",NULL,NULL,"Text file(*.txt)|*.TXT|",NULL);
讀取文件:
virtual UINT Read( void* lpBuf,
UINT nCount );
throw( CFileException
);
lpbuf緩沖區指針
nCount要讀的長度
/*
int len=file.GetLength(); char *buffer=new char[len+1]; if(!buffer) { MessageBox("Allocating fail"); } else { try { file.Read(buffer,len); } catch(CFileException *e) { MessageBox("Reading file error"); file.Close(); e->Delete(); return ; } */ 獲取當前時間: current_time=CTime::GetCurrentTime(); str_year.Format("%d",current_time.GetYear()); str_month.Format("%d",current_time.GetMonth()); str_day.Format("%d",current_time.GetDay()); CString m_date=str_year+"-"+str_month+"-"+str_day;

