更新时间:2023-11-08 19:46:34
使用System.IO.Directory.GetFiles
.请参阅 http://msdn.microsoft.com/en-us/library/system.io .directory.aspx [ ^ ].—SA
UseSystem.IO.Directory.GetFiles
. See http://msdn.microsoft.com/en-us/library/system.io.directory.aspx[^].—SA
尝试:
string[] files = Directory.GetFiles(path);
Console.WriteLine(files.Length);
HI,
以下是简单的方法及其工作方式:
following is the simple way and its working:
System.IO.DirectoryInfo dirInfo = new System.IO.DirectoryInfo(Server.MapPath(folderName));
if (dirInfo.Exists)
{
int fileCount=dirInfo.GetFiles("*.*").Count()
}
如果它有效,请回复我.::)
Reply me if its working.... : )