Results 1 to 2 of 2

Thread: Displaying the contents of a folder in a listview...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    Coventry, England
    Posts
    169

    Displaying the contents of a folder in a listview...

    I want to read all the files in a folder (all of extention .zip) and list them all within a listview. I have the listview and header set up (I done the hard part :P).

    Thanks for any help.

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    this might help
    PHP Code:
            public void LoadDirectoryFiles(string targetDir)
            {
                
    System.IO.DirectoryInfo dr = new System.IO.DirectoryInfo(targetDir);
                
    FileInfo[] fi dr.GetFiles();
                foreach(
    FileInfo f in fi)
                {
                    
    //ADD UR LISTVIEW name here.
                
    }
            }

            private 
    void button1_Click(object senderSystem.EventArgs e)
            {
                
    LoadDirectoryFiles(@"e:\");
            } 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width