Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Create / remove directory

Reply
Thread Tools

Create / remove directory

 
 
=?Utf-8?B?U3VzaGlTZWFu?=
Guest
Posts: n/a
 
      10-09-2007
Hello. I have problem with create and then remove directory on my site.
It works like this. My page
1) create directory
Directory.CreateDirectory(DirectoryPath);
2) put some files
3) Remove directory
Directory.Delete(DirectoryPath, true);

And I have problem here. For some strange reasons this directory because
read only and locked. I can't even open this until reopen my visial studio.
Why it happend? How I can create directory with full access and then remove
it with all files and subfolders inside?
 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      10-09-2007
Only when using VS.NET ? Also if the file is server by ASP.NET it is lokced
by default for a short period of time. Soa ccessing the site from a web
client could prevent deleting it immedately after.

Not sure what you are doing with those directories/files but my personal
preference would be to avoid this or perhaps to serve them direcdtly from an
aspx page (in whihc case IIS won't lock them).

Also double check of course that you are properly closing those file...

--
Patrice


"SushiSean" <(E-Mail Removed)> a écrit dans le message de
news: http://www.velocityreviews.com/forums/(E-Mail Removed)...
> Hello. I have problem with create and then remove directory on my site.
> It works like this. My page
> 1) create directory
> Directory.CreateDirectory(DirectoryPath);
> 2) put some files
> 3) Remove directory
> Directory.Delete(DirectoryPath, true);
>
> And I have problem here. For some strange reasons this directory because
> read only and locked. I can't even open this until reopen my visial
> studio.
> Why it happend? How I can create directory with full access and then
> remove
> it with all files and subfolders inside?



 
Reply With Quote
 
 
 
 
=?Utf-8?B?U3VzaGlTZWFu?=
Guest
Posts: n/a
 
      10-09-2007
Thanks, what about derectory security?
I mean in function Directory.Create(DirName, Security)
exist Security param. How set up this to make dir with full access?

"Patrice" wrote:

> Only when using VS.NET ? Also if the file is server by ASP.NET it is lokced
> by default for a short period of time. Soa ccessing the site from a web
> client could prevent deleting it immedately after.
>
> Not sure what you are doing with those directories/files but my personal
> preference would be to avoid this or perhaps to serve them direcdtly from an
> aspx page (in whihc case IIS won't lock them).
>
> Also double check of course that you are properly closing those file...
>
> --
> Patrice


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
Httpmodule still executed even if remove using <remove> config entry Simon-Pierre Jarry ASP .Net 2 08-10-2005 11:22 AM
How to remove items from add/remove list please Caractucus Potts Computer Support 5 07-03-2005 10:31 PM
Re: Why I can not remove all dialers after "remove"-I have two anti-dialers programs Joseph Ladovic Computer Security 3 05-26-2005 03:00 AM
Add/Remove Program Glitch: Asks If I Want To To Remove Wrong Program ? Robert11 Computer Support 6 08-02-2004 09:02 PM



Advertisments