Create / remove directory

G

Guest

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?
 
P

Patrice

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...
 
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top