ASP.NET读取目录及文件

来源:互联网 发布:算法具有哪些重要特性 编辑:程序博客网 时间:2024/03/29 08:19
<span style="font-size:18px;">DirectoryInfo dir = new DirectoryInfo(path);FileInfo[] files = dir.GetFiles();</span>
<span style="font-size:18px;">for(int i=0;i<files.Length;i++){</span>
<span style="font-size:18px;"><span style="white-space:pre"></span>if(files[i].Name == name){</span>
<span style="font-size:18px;"><span style="white-space:pre"></span>break;</span>
<span style="font-size:18px;"><span style="white-space:pre"></span>}</span>
<span style="font-size:18px;">}</span>
<span style="font-size:18px;"></span>
<span style="font-size:18px;">超简单的</span>

0 0
原创粉丝点击