Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Configuration;
- using System.Threading.Tasks;
- using System.IO;
- namespace s4l2 {
- class Program {
- Queue<string> q;
- List<string> getFilesList(string path) {
- List<string> files = new List<string>();
- if (!Directory.Exists(path))
- return files;
- Queue<string> q = new Queue<string>();
- q.Enqueue(path);
- while (q.Count > 0) {
- string current = q.Dequeue();
- foreach (string dir in Directory.GetDirectories(current))
- q.Enqueue(dir);
- files.AddRange(Directory.GetFiles(current));
- }
- return files;
- }
- static void Main(string[] args) {
- Console.WriteLine(ConfigurationSettings.AppSettings["path"]);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement