a little bit of tech, a little bit of green, to help tame the savage techmachine.

void CTestDlg::OnOK()
{
     // TODO: Add extra validation here
     CString s;
     CFile file;
     file.Open("D:\\music\\经典老歌精选
\\bglist.js",CFile::modeCreate|CFile::modeWrite);
     file.SeekToBegin(); 
     CString strFileTitle;
     CFileFind finder;
     BOOL bWorking = finder.FindFile("D:\\music\\经典老歌精选
\\*.mp3");
     while(bWorking)
     {
      bWorking=finder.FindNextFile();
      strFileTitle=finder.GetFileTitle(); 
      s.Format("mkList(\"
http://linux.ustc.edu.cn/~xyu/songs/foreign/"+strFileTitle+".mp3\",\""+strFileTitle+"\")\n");
      file.Write(s,s.GetLength());
     }  
     file.Flush();
     file.Close();
     CDialog::OnOK();
}

posted on 2004-10-12 22:41  xyublog  阅读(632)  评论(0编辑  收藏  举报