Click here to Skip to main content
15,878,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi to all...
here some php code is their.. but i want to c# code..
if any body knows pls let me know.
function ReadFolderDirectory($dir,$listDir= array())
  $listDir = array();  
   if($handler = opendir($dir)) 
      while (($sub = readdir($handler)) !== FALSE)
         if ($sub != "." && $sub != ".." && $sub != "Thumb.db") 
                $listDir[] = $sub; 
               $listDir[$sub] = $this->ReadFolderDirectory($dir."/".$sub); 
  return $listDir;    
Updated 1-Aug-11 22:54pm
Sergey Alexandrovich Kryukov 2-Aug-11 5:08am    
FolderDirectory? (Sigh...) :-)
komalilella 2-Aug-11 5:24am    
actually i have some directory structure like this:
now i want to convert that directory structure into c#.if knows pls let me know.

1 solution

This is System.IO.Directory. There is one difficulty, so see the solution here: Directory.Get.Files search pattern problem[^].


Share this answer
komalilella 3-Aug-11 2:08am    
hi sakryukov...
u saw my directory structure above right...wat i will do means u can seralize to directory structure or converting that directory structure into json..
pls give any simple example...
iam new to json..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900