Monday, February 6, 2012

Loop through all the files in C# 2010

Hi All,

I migrated from VBA to C# a while back. Earlier, with VBA, I used to create Re-Cursive function to loop through all inner folders in a given folder. For example, if I have to search whole files in C: Drive, I will probably need to loop through Drive, then folders and subfolders in VBA. But in C#, you can simply give a parameter to search through the subdirectories as well.

Code:

DirectoryInfo parent = new DirectoryInfo(@"C:\Vikas");
FileInfo[] files = parent.GetFiles("*.*", SearchOption.AllDirectories);


The files array will contain all the files within the Folder "Vikas" and it's subfolder.

Thanks,
Vikas B

Org Charts using Google docs

Hi All,

I was reading a thread in LinkedIn. Someone had asked if it is possible to create a ORG chart in Excel or not. I tried to google it and found a very interesting way to do it using Google Docs.

Create Org Chart using Google Docs/

Cheers!
Vikas B