Hi too all,
I'm trying to write a simple program which will find all the folders in the
c drive, but i'm having problems
I've managed to search the root of c drive folders but having problems with
search them. Here is the code i've been so far
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string[] folders = Directory.GetDirectories(@"C:\");
int p = folders.Length;
System.Random RandNum = new System.Random();
int mRandomNumber = RandNum.Next(1, p);
Console.WriteLine(folders.GetValue(mRandomNumber)+ @"\");
}
}
}
can someone offer a helping hand?
thanks