Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hoe remove the Exception when i delete the directory (give the Exception used by other program)

my code is this

if (Directory.Exists(@"C:\\WinDirectory"))
Directory.Delete(@"C:\WinDirectory", true);

what code write so that in asp,net so that our directory deleted each time
Posted
Updated 26-Feb-10 1:24am
v2

If the directory is being used by another application then you can't get ride of the Exception. You can handle the exception though.
 
Share this answer
 
Could you please mention the exception that you are getting in the above code?
 
Share this answer
 
Probably the error you're getting is because ASP.Net needs more permissions to interact with the OS, you should start checking the setting for IIS, look here

IIS Security
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900