Home All Groups Group Topic Archive Search About

How to delete all the files in the specified folder?

Author
26 Dec 2005 11:55 AM
Ivan Abramov
by meanse of System.IO namespace?
(The task is being doing easily by screepting runtime.)

Thanks in advance.

Author
26 Dec 2005 1:24 PM
Vadym Stetsyak
string [] fileEntries = Directory.GetFiles(targetDirectory);
foreach(string fileName in fileEntries)
{
    File.Delete(Path.Combine(targetDirectory, fileName));
}

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

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.
Author
26 Dec 2005 1:47 PM
Ivan Abramov
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.
>
>
>
Author
26 Dec 2005 1:51 PM
Ivan Abramov
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.
>
>
>

AddThis Social Bookmark Button