Re: deleting *.doc in asp.net
- From: "John Timney \( MVP \)" <timneyj@xxxxxxxxxxxxx>
- Date: Sun, 20 Nov 2005 16:19:14 -0000
off the top of my head try something like this :
DirectoryInfo dir = new DirectoryInfo(@"c:\tmp");
FileInfo[] docfiles = dir.GetFiles("*.doc");
Foreach( FileInfo f in docfiles)
{
File.Delete( f.Name)
}
--
Regards
John Timney
ASP.NET MVP
Microsoft Regional Director
"Stimp" <ren@xxxxxxxxxx> wrote in message
news:slrndo111i.umi.ren@xxxxxxxxxxxxxxxxxxxxxxxxx
>I want to delete all my .doc files in a specific directory.
>
> I tried to do this using the File.Delete method, but it doesn't allow
> "*.doc" paths.
>
> So I tried the following code:
>
> Dim objFSO = Server.CreateObject("Scripting.FileSystemObject")
> objFSO.DeleteFile(Server.MapPath("*.doc"))
>
> and it works on my local pc, but I doubt I should be using classic asp
> components with asp.net.. what was is the equivalent function in
> asp.net?
>
> Cheers.
> --
>
> fiddlewidawiddum
.
- Follow-Ups:
- Re: deleting *.doc in asp.net
- From: Stimp
- Re: deleting *.doc in asp.net
- From: Stimp
- Re: deleting *.doc in asp.net
- References:
- deleting *.doc in asp.net
- From: Stimp
- deleting *.doc in asp.net
- Prev by Date: Re: debug symbols VS 2005
- Next by Date: Re: viestate of arrays
- Previous by thread: deleting *.doc in asp.net
- Next by thread: Re: deleting *.doc in asp.net
- Index(es):
Relevant Pages
|