Solved

enumerating files in a virtual directory

Posted on 2004-10-29
360 Views
Last Modified: 2013-11-15
Setup:  ASPX application residing on a Windows 2000 server; virtual directory pointing to a Windows 2000 server that contains a few subfolders and a handful of textfiles
Experiences:
1.)  the application is supposed to create a list box of all the *.txt files in one of the subfolders but the list box only shows up blank - no errors reported;  this would make me believe that it cannot find the files in the virtual directory but that isn't the case because I can type in the virtual directory path and see all the files I should be seeing in the list box
2.)  I can create a simple ASP page that will enumerate the files in the UNC location on the 2000 IIS server and it correctly enumerates and lists the files in the remote location

Question(s):
1.)  Is this an issue with the .NET Framework that security or permissions needs to be relaxed in order to be able to enumerate files in a virtual directory located on another server?
2.)  What needs to be done to be able to have my .NET app correctly enumerate the files in this virtual directory?
0
Question by:Pasdargent
    3 Comments
     
    LVL 17

    Expert Comment

    by:AerosSaga
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
       If Not IsPostBack Then
           Dim di As DirectoryInfo = New DirectoryInfo("c:\Events\HTML\Event\")
           Dim ds As DataSet = new DataSet()
           Dim fis as FileInfo()
           Dim fi as FileInfo()

           ds.Tables.Add()
           ds.Tables(0).Columns.Add("FileName")
           ds.Tables(0).Columns.Add("path")

           fis = di.GetFiles()
           For Each fi in fis
               Dim dr as DataRow = ds.Tables(0).NewRow()
               dr(0) = fi.Name
               dr(1) = "your web application virtual directory name" & fi.Name
               ds.Tables(0).Rows.Add (dr)
           Next

           ddlPages.DataSource = ds
           ddlPages.DataTextField = "FileName"
           ddlPages.DataValueField = "path"
           ddlPages.DataBind()

    End Sub

    Aeros
    0
     
    LVL 3

    Author Comment

    by:Pasdargent
    The comment provided  by AerosSaga did not work.  We have since learned that what we are trying to do is not supported.  Please delete this question and refund points or give 50 points to AerosSaga for providing the only assistance.
    0
     

    Accepted Solution

    by:
    PAQed with points refunded (250)

    modulo
    Community Support Moderator
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

     Java Android Coding Bundle

    Whether you're an Apple user or Android addict, learning to code for the Android platform is an extremely valuable, in-demand skill. It all starts with Java, the language behind the apps and games that make Android the top platform it is today.

    A quick step-by-step overview of installing and configuring Carbonite Server Backup.
    This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
    This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
    The viewer will learn how to download and install Comodo Backup on Windows 7. Comodo Backup is another solution for backing up your computer. It is free for local backup and online backup has differing amounts depending on storage required. In my op…

    877 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now