📄 subject_55267.htm
字号:
<p>
序号:55267 发表者:夏雪宜 发表日期:2003-10-08 14:50:29
<br>主题:如何取到一个文件夹中所有的文件的名称
<br>内容:如题,我想取到一个文件夹中所有的文件名称,用如下办法,但总是丢掉文件加中的第一个文件的名称,请教如何来解决?<BR> strFilePath=strFilePath+"\\*.tt";<BR> CFileFind m_strFile;<BR> m_strFile.FindFile(strFilePath,0);<BR> CString strShowFiles;<BR> i=0;<BR> while(m_strFile.FindNextFile())<BR> {<BR> strShowFiles=m_strFile.GetFileName();<BR> lpList->InsertString(i,strShowFiles);<BR> i++;<BR> }<BR> 其中strFilePath为文件夹的路径
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:michael 回复日期:2003-10-08 15:01:43
<br>内容: strFilePath=strFilePath+"\\*.tt";<BR> CFileFind m_strFile;<BR> m_strFile.FindFile(strFilePath,0);<BR> CString strShowFiles;<BR> i=0;<BR> while(m_strFile.FindNextFile())<BR> {<BR> strShowFiles=m_strFile.GetFileName();<BR> lpList->InsertString(i,strShowFiles);<BR> i++;<BR> }<BR>/////////////////////////////Add this////////////////////////////////<BR>strShowFiles=m_strFile.GetFileName();<BR>您这种写法应该是丢掉最后一个。<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:夏雪宜 回复日期:2003-10-08 16:08:59
<br>内容:你说得对,得确实这样,但我发现有时丢掉的不止一个文件,所以又没有其他的方法可以将一个文件夹中所有的文件都列入我的列表中
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:michael 回复日期:2003-10-08 16:21:35
<br>内容:我都是这么做的,没发生丢文件的情况。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:muzi 回复日期:2003-10-08 21:49:18
<br>内容:我也学会了,谢谢
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -