Thursday, 30 June 2016

Get List Of All Files Present in Directory In Windows Application Using C#.Net

6/30/2016 - By Pranav Singh 0

This article will show how to get list of all files present in directory in windows application using c#.net. In this I have shown the directory file in the listbox.

So for this article first we will create a new windows application and add textbox, button and list box control.

 
Now generate the button click event and add the below code into the form.

  private void button1_Click(object sender, EventArgs e)
        {
            string[] filePaths = Directory.GetFiles(txtDirectoryPath.Text);
            listBox1.DataSource = filePaths;
            lblcount.Text = filePaths.Length.ToString();
        }

In above I have shown the lots of all the files in listbox control and shown the count of the files. Now we have done. Run the application and check the output.\

Now we will check the file at a specific location.


Now check the final output.


About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top