我想從ASP.NET MVC 3應用程序中的server.MapPath
獲取文件夾名稱。 在此操作中,如果.jpg文件位於該文件夾中,則必須檢查(如果給定文件夾名稱中存在更多文件夾),並且如果是,則返回該文件夾。如何從給定路徑獲取子文件夾名稱Server.MapPath
string path = Server.MapPath("Content/");
DirectoryInfo dInfo = new DirectoryInfo(path);
DirectoryInfo[] subdirs = dInfo.GetDirectories();
if (Directory.Exists(path))
{
ArrayList ar = new ArrayList();
// This path is a directory
ar.Add(path);
//ProcessDirectory(path);
}
你好謝謝你給了我回應試圖獲得文件夾,但我沒有得到的解決方案,我已經發布我的代碼在我的查詢請檢查一次..並給任何暗示請 – Victor