Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

ASP.NET/C#: 'D:/' is a physical path, but a virtual path was expected.

How can I get this to work with an absolute path?
<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%

string[] filesPath = Directory.GetFiles(Server.MapPath("D:\\"));
List<ListItem> files = new List<ListItem>();
foreach (string path in filesPath)
{
Response.Write( path );
}
 
%>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of OriNetworks
OriNetworks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial