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.Threading.Tasks;
- using System.IO;
- namespace zad10._1._6
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Unesite putanju: ");
- string putanja = Console.ReadLine();
- while (!Directory.Exists(putanja))
- {
- Console.WriteLine("Putanja ne postoji. Unesite novu putanju: ");
- putanja = Console.ReadLine();
- }
- Console.WriteLine($"\nOd navedene putanje može se doći do sljedećih direktorija: \n");
- Direktoriji(putanja);
- }
- static void Direktoriji (string putanja)
- {
- string[] sDirs1 = Directory.GetDirectories(putanja);
- if (sDirs1.Length == 0) return;
- foreach (string sDir1 in sDirs1)
- {
- string DirName = new DirectoryInfo(sDir1).Name;
- Console.WriteLine($"\nDirektorij {DirName} (putanja: {sDir1})");
- Direktoriji(sDir1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement