Can someone help how I can also copy user's desktop folder's subfolders and their files with the code below this text?
For moment I can only copy files from " + computer + "\c$\Users\Desktop folder but not the subfolders and their files.
For moment I can only copy files from " + computer + "\c$\Users\Desktop folder but not the subfolders and their files.
C#:
[B][I]string[] dirs = Directory.GetDirectories("[/I][/B][B][I]\\\\[/I][/B][B][I]" + computer + "[/I][/B][URL="file://c$//Users//"][B][I]\\c$\\Users\\[/I][/B][/URL][B][I]");[/I][/B]
[B][I] foreach (string item in dirs)[/I][/B]
[B][I] {[/I][/B]
[B][I] FileInfo f = new FileInfo(item);[/I][/B]
[B][I] user2 = "[/I][/B][B][I]\\\\[/I][/B][B][I]" + computer + "[/I][/B][URL="file://c$//Users//"][B][I]\\c$\\Users\\[/I][/B][/URL][B][I]" + f.Name + "[/I][/B][URL="file://desktop/"][B][I]\\Desktop[/I][/B][/URL][B][I]";[/I][/B]
[B][I] if (Directory.Exists(user2))[/I][/B]
[B][I] {[/I][/B]
[B][I] user = "C:\\Backup" + computer + "" + f.Name + "[/I][/B][URL="file://desktop/"][B][I]\\Desktop[/I][/B][/URL][B][I]";[/I][/B]
[B][I] Directory.CreateDirectory(user);[/I][/B]
[B][I] DirectoryInfo folder = new DirectoryInfo(user2);[/I][/B]
[B][I] FileInfo[] files = folder.GetFiles();[/I][/B]
[B][I] foreach (FileInfo file in files)[/I][/B]
[B][I] {[/I][/B]
[B][I] string temppath = Path.Combine(user, file.Name);[/I][/B]
[B][I] file.CopyTo(temppath, true);[/I][/B]
[B][I] }[/I][/B]
[B][I] }[/I][/B]