|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to delete all the files in the specified folder?by meanse of System.IO namespace?
(The task is being doing easily by screepting runtime.) Thanks in advance. string [] fileEntries = Directory.GetFiles(targetDirectory);
foreach(string fileName in fileEntries) { File.Delete(Path.Combine(targetDirectory, fileName)); } Show quote "Ivan Abramov" <IvanAbra***@discussions.microsoft.com> wrote in message news:62EB7291-8588-42C6-972F-56D6DA0752EA@microsoft.com... > by meanse of System.IO namespace? > (The task is being doing easily by screepting runtime.) > > Thanks in advance. I said "all the files in the specified folder", that means the file names are
unknown. It must be something like for each... in the folder. Is it possible? Thanks in advance. Show quote "Vadym Stetsyak" wrote: > string [] fileEntries = Directory.GetFiles(targetDirectory); > foreach(string fileName in fileEntries) > { > File.Delete(Path.Combine(targetDirectory, fileName)); > } > > -- > Vadym Stetsyak aka Vadmyst > http://vadmyst.blogspot.com > > "Ivan Abramov" <IvanAbra***@discussions.microsoft.com> wrote in message > news:62EB7291-8588-42C6-972F-56D6DA0752EA@microsoft.com... > > by meanse of System.IO namespace? > > (The task is being doing easily by screepting runtime.) > > > > Thanks in advance. > > > Oh, sorry, Vadym,
I'm blind, of cause, it's ok. Greate thanks. Show quote "Vadym Stetsyak" wrote: > string [] fileEntries = Directory.GetFiles(targetDirectory); > foreach(string fileName in fileEntries) > { > File.Delete(Path.Combine(targetDirectory, fileName)); > } > > -- > Vadym Stetsyak aka Vadmyst > http://vadmyst.blogspot.com > > "Ivan Abramov" <IvanAbra***@discussions.microsoft.com> wrote in message > news:62EB7291-8588-42C6-972F-56D6DA0752EA@microsoft.com... > > by meanse of System.IO namespace? > > (The task is being doing easily by screepting runtime.) > > > > Thanks in advance. > > > |
|||||||||||||||||||||||