how to list all files of folder in page?

Discussion in 'C#' started by gilgalbiblewheel, Aug 8, 2007.

  1. #1
    gilgalbiblewheel, Aug 8, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Using ASP.Net and displaying it in a gridview would look like:


    Sub Page_Load(sender as Object, e as EventArgs) Handles Me.Load
    If Not Page.IsPostBack then
    Dim dirInfo as New DirectoryInfo(Server.MapPath(""))

    Gridview1.DataSource = dirInfo.GetFiles("*")
    Gridview1.DataBind()
    End If
    End Sub
     
    AstarothSolutions, Aug 8, 2007 IP
  3. gilgalbiblewheel

    gilgalbiblewheel Well-Known Member

    Messages:
    435
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    I need the asp version.
     
    gilgalbiblewheel, Aug 9, 2007 IP