CStdioFile file;
file.Open("text.txt",CFile::modeWrite | CFile::modeCreate);
CHAR szValue[256];
sprintf(szValue,"%s","E:\\music\\歌曲\\日不落.mp3");
file.WriteString(szValue);
file.Close();刚试了,可以正常写入。
file.Open("text.txt",CFile::modeWrite | CFile::modeCreate);
CHAR szValue[256];
sprintf(szValue,"%s","E:\\music\\歌曲\\日不落.mp3");
file.WriteString(szValue);
file.Close();刚试了,可以正常写入。
我的环境是Microsoft Visual Studio 2005
file.Open(_T(path),CFile::modeCreate|CFile::modeWrite);
file.Write(str,str.GetLength());
file.Close();
CString str=_T("E:\\music\\歌曲\\日不落.mp3");
file.Open(_T(path),CFile::modeCreate ¦CFile::modeWrite);
file.Write(str,str.GetLength());
file.Close();
这个就是输出结果了,还是不对啊
CString str=_T("E:\\music\\歌曲\\日不落.mp3");
file.Open(_T(path),CFile::modeWrite ¦ CFile::modeWrite);
file.Write(str,str.GetLength());
file.Close();
你最好不要直接复制,重新打一遍吧。我试过了,没有问题。
|
|
CStdioFile f;
WCHAR str[256] = L"E:\\music\\歌曲\\日不落.mp3";
f.WriteString(str);