文件框设置

CFileDialog类封装了Windows常用的文件对话框。常用的文件对话框提供了一种简单的与Windows标准相一致的文件打开和文件存盘对话框功能。

CFileDialog fileDlg(FALSE); //构造对话框对象(FALSE)表示保存(TRUE)表示打开

MSDN里有说明,要以 两个 '|' 结尾,你在最后加上两个 ‘|’ 就好了,如下:

CFileDialog fileDlg(TRUE,NULL,NULL,0,"cpp文件(*.cpp)|*.cpp|txt文件(*.txt)|*.txt||");

// CFileDialog fileDlg(FALSE,"xls","*.xls", OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT,"导出文件(*.xls)|*.xls|");

 

CString filename;
 CString fileControl = "           ";
 CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
 CControlInfo *pControlInfo = CControlInfo::GetSingletonPtr();

 CTime time = CTime::GetCurrentTime();
 CString sTime;
 sTime.Format("%d-%d-%d  %d:%d:%d", time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond());
 CString sNameTime;
    sNameTime.Format("//Bin//DataFile//%d-%d-%d  %d.%d.%d.csv", time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond());

 filename = pControlInfo->GetSysCurPath() + sNameTime;
  CFile  file(filename, CFile::modeCreate | CFile::modeWrite);

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值