现想将一个字符串
例如:
CString strValue;
strValue = "select xx from table ";写到一个空白的文本文件中,
谢谢各位
例如:
CString strValue;
strValue = "select xx from table ";写到一个空白的文本文件中,
谢谢各位
解决方案 »
- MFC你学了多久?
- 64位Win上面VC编的64位程序,int和long都是多少字节长?
- 对话框中的Myedit是一个edit派生类对象,我想改变Myedit的字体大小,我的做法见代码,为什么不生效呢?
- 请教各位大侠,如何让程序运行后就最小化?
- xtreme toolkit 9.601 向导 XTAppWizard.dsw 的源代码没有
- InstallShield dev 8 的一些问题
- CGridCtrl控件中的内容如何删除多个选中行(选中行可能不连续)
- 不能做任何连接,因为目标机器积极地拒绝它
- 用StretchBlt缩小图片时会发生颜色严重失真,请问有什么办法解决?
- 请问诸位,如何动态创建一组按钮,并为它们创建事件处理函数???
- 关于ON_UPDATE_COMMAND_UI
- 怎样读取编辑框的字符(代码是怎么编写的?)
WriteFile也可以用CStdioFile的WriteString
file.Open(.........);
file.WriteString(strValue );
file.close();
strValue = "select xx from table ";
CStdioFile f;
if ( f.Open( FilePath ,CFile::modeCreate|CFile::modeWrite ) )
{
f.WriteString( strValue );
f.Close();
}
#include "fstream.h"fstream In("Result.txt",ios::in|ios::out);
In<<"select xx from table "<<'\n';
file = fopen(path,"w");
fprintf(file,"select xx from table ");
fclose(file);