请看下面的代码:
foreach (FileInfo f in dir.GetFiles("*.*"))
{
Files += "<div class='divFilesBody_Row'>";
Files += "<div class='divFilesBody_Left'>";
Files += " ";
Files += "</div>";
Files += "<div class='divFilesBody_Name'>";
Files += "<img class='imgFile' src='~/Images/Download/file.png' />";
Files += "<span class='FileName'>";
Files += f.Name;
Files += "</span>";
Files += "</div>";
Files += "<div class='divFilesBody_FileType'>";
Files += f.???????
Files += "</div>";
Files += "<div class='divFilesBody_FileSize'>";
Files += f.Length;
Files += "</div>";
Files += "<div class='divFilesBody_FileCreationDate'>";
Files += f.CreationTime;
Files += "</div>";
Files += "<div class='divFilesBody_FileDownload'>";
Files += "<a class='FileLink' <a target='_blank' href='../Files" + lastpath + "/" + f.Name + "'>";
Files += "<img class='imgDownload' src='~/Images/Download/Download.png' />";
Files += "</a>";
Files += "</div>";
Files += "<div class='divFilesBody_Right'>";
Files += " ";
Files += "</div>";
Files += "</div>";
}
看看这一行:
f.???????
如何使用 .net 方法 获取f (FileInfo) 的文件扩展名?
提前致谢