VC6.0 CString写如txt文件的方法

来源:互联网 发布:百度虚拟主机绑定域名 编辑:程序博客网 时间:2024/05/16 15:49

VC6.0 将 CString 变量值写入txt 文件
例如:
我们取出当前系统时间

    CString str;    double d_curent_time = GetTickCount();    //将double 转为 CString    str.Format("%f",d_curent_time);    CStdioFile cFile;    if (cFile.Open("c:\\log.txt",CFile::modeCreate|CFile::modeReadWrite))    {        cFile.WriteString(str);    }    cFile.Close;

通过这种方式就会在c盘看到一个log.txt 的文件, 这种方式有利于帮助我们调试,查看变量的值

原创粉丝点击