c# 遍历目录
string strDirlist = sPath;//传入路径
DirectoryInfo thisOne = new DirectoryInfo(strDirlist);
FileInfo[] fileInfo = thisOne.GetFiles();
foreach (FileInfo fi in fileInfo)
{
if(fi.Extension.toString()== "XML ")
{
Response.Write( " <a href= ' " + sPath + "\\ " + fi.Name.ToString() + " ' target= '_blank '> " + fi.Name.ToString() + " </a> -- "+fi.Length/1024/1024 " M<br> ");
}
}