Click here to Skip to main content
15,886,036 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can i delete an file from folder in wpf ? Anybody please help me.........
Posted
Comments
DamithSL 6-Dec-14 0:13am    
what is the issue with deleting? have you tried? if you Google[^] you can find many resource. if you have specific question please elaborate more with the problem and code samples you tried so far.

1 solution

try this

C#
var dir = new DirectoryInfo(@FolderPath);
dir.Attributes = dir.Attributes & ~FileAttributes.ReadOnly;
dir.Delete(true);
 
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