Within this question I am using Visual Studio 2008. My code is very simple, because it was adopted from the reference I snapped up from the web. I am using ASP/VB.Internet, IIS6. on the Home windows Server 2003 box.

I have checked out various sources online, and haven't had the opportunity to patch together an effective result.

The objective of this really is to list out a slew of sites as well as their particular files, and permit the consumer to eventually manage that directory (for example open and remove files).

Here's my ASPX page:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="DirectoryList.aspx.vb" Inherits="VCMReports.DirectoryList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
    <asp:DataGrid runat="server" id="articleList" Font-Name="Verdana"
    AutoGenerateColumns="False" AlternatingItemStyle-BackColor="#eeeeee"
    HeaderStyle-BackColor="Navy" HeaderStyle-ForeColor="White"
    HeaderStyle-Font-Size="15pt" HeaderStyle-Font-Bold="True">
    <asp:HyperLinkColumn DataNavigateUrlField="Name" DataTextField="Name" 
           HeaderText="File Name" />
    <asp:BoundColumn DataField="LastWriteTime" HeaderText="Last Write Time"
        ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
    <asp:BoundColumn DataField="Length" HeaderText="File Size"
        DataFormatString="{0:#,### bytes}" />


Here is the CodeBehind:

Imports System.IO
Imports System.IO.DirectoryInfo

Partial Public Class DirectoryList
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim dirInfo As New DirectoryInfo(Server.MapPath("V:\Users\"))

        articleList.DataSource = dirInfo.GetFiles("V:\Users\")

    End Sub
    Protected Sub GetFiles()

        Dim files() As String = Directory.GetFiles("V:\Users\")

        Dim myDir As DirectoryInfo = New DirectoryInfo("V:\Users\")
        Dim fileInfos() As IO.FileInfo = myDir.GetFiles("*.*")
    End Sub

When starting the page, the next error seems:

'V:\Users\' is not a valid virtual path. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: 'V:\Users\' is not a valid virtual path.

A Few Things I have attempted:

  1. Around the server, I've planned the drive and also the directory.
  2. Permissions appear to become correctly set, impersonate is correct.
  3. Basically would list a directory in the directory "C:InetpubDirectory", there's no failure.
  4. I actually do appreciate this is incomplete for that Directory listing portion, this can only list files (which means this will have to be modified.
  5. I've attempted to produce a Virtual Directory, and also the application presented exactly the same error.
  6. On my small local development machine, I have a similar path produced - same error.

How can i see the items in a shared directory and it is files?

Here you discover the solution in your first area of the question, why Server.MapPath cannot(and cannot) be employed to resolve the road to a network share: http://forums.asp.net/t/785846.aspx/1

The 2nd question pointed out inside your comment is how you can list all sites inside a directory: