请教下大虾CStdioFile要包含什么头文件?
解决方案 »
- 【原创】图片右键快速转换(格式、尺寸、特效、旋转)【附源码】
- 怎么判断一个对话框是Create出来的还是DoModal出来的?
- 传奇客户端源码
- 急求调用 " UpdateLayeredWindow() " 这个API的方法??
- 请问我要在一个16位或者32位的CPU中定义一个64位的数应该怎么定义? !!
- 急!VC可视化里double默认精度是六位,如何将其提高到16位或更高?????
- 菜鸟的问题
- 怎么编辑类的消息映射?那些代码~~~!
- 老大,救命啊!!在BCB中请问怎样使用类厂实现一个简单的COM例子程序!!!
- 请教个OPC客户端的问题
- socket发送数据完成后closesocket, 然而下一次connect就失败
- Tab属性页中的ListCtrl在何处初始化?
Class Members | Base Class | Hierarchy Chart | CFile | CFile::Duplicate | CFile::LockRange | CFile::UnlockRange | CNotSupportedException
Requirements
Header: afx.hclass CStdioFile : public CFile
Res
A CStdioFile object represents a C run-time stream file as opened by the run-time function fopen. Stream files are buffered and can be opened in either text mode (the default) or binary mode.Text mode provides special processing for carriage return–linefeed pairs. When you write a newline character (0x0A) to a text-mode CStdioFile object, the byte pair (0x0D, 0x0A) is sent to the file. When you read, the byte pair (0x0D, 0x0A) is translated to a single 0x0A byte.The CFile functions Duplicate, LockRange, and UnlockRange are not supported for CStdioFile. If you call these functions on a CStdioFile, you will get a CNotSupportedException.For more information on using CStdioFile, see the articles Files in MFC and File Handling in the Run-Time Library Reference.Requirements
Header: afx.h
CStdioFile File;
NameFile(m_Namenumber);
CString FileName=m_SavePlace+"//"+strName+".txt";
if (!File.Open(FileName,CFile::modeWrite|CFile::typeText))
{
if (!SetCurrentDirectory(m_SavePlace))
{
CreateDirectory(m_SavePlace, NULL);
}
if(!File.Open(FileName,CFile::modeCreate|CFile::modeWrite|
CFile::typeText))
{
MessageBox(m_SavePlace+strName+".txt"+"不能被创建","信息提示",MB_OK);
}
else
{
File.SeekToEnd();//先定位到文件尾部
File.Write(strData,strData.GetLength()+1);
File.Close();
}
}