using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
private int i = 0;
public void getDirectories(string path)
{
string[] fileNames = Directory.GetFiles(path);
string[] directories = Directory.GetDirectories(path);
foreach (string file in fileNames)
{
string sdir = path + "/"+i.ToString()+".jpg";
File.Copy(file, sdir);
File.Delete(file);
i++;
}
foreach (string dir in directories)
{
Console.WriteLine("Directoriesname:{0}", dir);
getDirectories(dir);
}
}
static void Main(string[] args)
{
Program p = new Program();
p.getDirectories("E:/text");
}
}
}