Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to solve this strong name issue? Pin
kolu narayan11-Oct-06 3:45
kolu narayan11-Oct-06 3:45 
GeneralRe: How to solve this strong name issue? Pin
kolu narayan11-Oct-06 5:21
kolu narayan11-Oct-06 5:21 
QuestionApp.Config and ConfigurationSection Pin
Jamie Nordmeyer10-Oct-06 13:07
Jamie Nordmeyer10-Oct-06 13:07 
AnswerRe: App.Config and ConfigurationSection Pin
led mike10-Oct-06 13:40
led mike10-Oct-06 13:40 
QuestionHow can I delete all files and subfolders within a directory ? Pin
Nadia Monalisa10-Oct-06 13:06
Nadia Monalisa10-Oct-06 13:06 
AnswerRe: How can I delete all files and subfolders within a directory ? Pin
led mike10-Oct-06 13:53
led mike10-Oct-06 13:53 
GeneralRe: How can I delete all files and subfolders within a directory ? Pin
Nadia Monalisa10-Oct-06 19:17
Nadia Monalisa10-Oct-06 19:17 
GeneralRe: How can I delete all files and subfolders within a directory ? Pin
Stefan Troschuetz10-Oct-06 21:52
Stefan Troschuetz10-Oct-06 21:52 
bashiwala wrote:
But even using Recursion requires non empty directory, isn't it ?


Sure it does, but the trick is that you recursively call your method for all current subfolders and delete them afterwards when everything inside was deleted. Here some pseudocode to get you an idea of the recursive function.
void delete(string directory)
{
  delete all files in directory

  for all subdirectories in directory
  {
    call delete with current subdirectory
    delete the now empty subdirectory
  }
}



"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

www.troschuetz.de

GeneralRe: How can I delete all files and subfolders within a directory ? Pin
led mike11-Oct-06 5:03
led mike11-Oct-06 5:03 
GeneralRe: How can I delete all files and subfolders within a directory ? Pin
hagarwal2-Mar-09 16:57
hagarwal2-Mar-09 16:57 
QuestionRe: How can I delete all files and subfolders within a directory ? Pin
led mike3-Mar-09 4:40
led mike3-Mar-09 4:40 
QuestionCD Product Key Pin
picasso210-Oct-06 12:18
picasso210-Oct-06 12:18 
AnswerRe: CD Product Key Pin
Guffa10-Oct-06 13:09
Guffa10-Oct-06 13:09 
GeneralRe: CD Product Key Pin
picasso210-Oct-06 17:59
picasso210-Oct-06 17:59 
QuestionUsing float.Parse(string) and language problems ! Pin
pe_chaut10-Oct-06 12:01
pe_chaut10-Oct-06 12:01 
AnswerRe: Using float.Parse(string) and language problems ! Pin
Guffa10-Oct-06 13:12
Guffa10-Oct-06 13:12 
QuestionSending commercial SMS Pin
Goalie3510-Oct-06 9:42
Goalie3510-Oct-06 9:42 
QuestionSensible way to scale and display large 1 bit Tiff G4!! Pin
abcxyz8210-Oct-06 8:36
abcxyz8210-Oct-06 8:36 
Questionplease HELLPPPP... Pin
nedimg10-Oct-06 8:16
nedimg10-Oct-06 8:16 
AnswerRe: please HELLPPPP... Pin
mikone10-Oct-06 9:40
mikone10-Oct-06 9:40 
QuestionError Pin
messages10-Oct-06 8:14
messages10-Oct-06 8:14 
AnswerRe: How do i make one o' these? (pic inside) Pin
Guffa10-Oct-06 11:28
Guffa10-Oct-06 11:28 
GeneralRe: How do i make one o' these? (pic inside) Pin
Anthony Mushrow10-Oct-06 13:18
professionalAnthony Mushrow10-Oct-06 13:18 
GeneralRe: How do i make one o' these? (pic inside) Pin
Dan Neely11-Oct-06 2:16
Dan Neely11-Oct-06 2:16 
QuestionDropdown list Pin
Naji.A10-Oct-06 7:37
Naji.A10-Oct-06 7:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.