Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need folder path and all files in that folder in windows application.

If anybody have any idea please share.

What I have tried:

string exePath = Application.StartupPath;
Posted
Updated 9-Mar-16 20:31pm
v2

1 solution

Here is the code. You can also used Application.StartupPath.
Also, your subject is slightly wrong as you say Asp.Net Windows Application as the ASP.Net is used for Web based app only.


C#
var path = System.IO.Directory.GetCurrentDirectory();
           var files = Directory.GetFiles(path).Select(f=>Path.GetFileName(f)).ToList();
           files.ForEach(f => Console.WriteLine(f));
           Console.ReadKey();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900