c# - cannot use Directory.GetFiles to get the server path -
in view mode, use following code, works for (int i=1; i<=3; i++) { string imgpath = "/temp/2490/" + i.tostring() + ".jpg"; <img width="200" height="200" src="@url.content(imgpath)" /> } i want let user view documents , download it, use following code , folder routes c:/temp/2490, , chrome don't let me view local files, wrong following codes? foreach (var file in directory.getfiles(@url.content("/temp/2490"), "*.jpg, *.pdf", searchoption.alldirectories)) { <li> <a href="@url.content(file)">document</a> </li> } directory.getfiles takes path parameter. not url. here want pass @"c:\temp\2490 .