Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Image is used by another process and not able to delete
Nafees abbasi
Jul 13 2016 4:47 PM
289
Reply
I'm trying to delete image after deleting record from list in wpf C#. but it always throw exception that file is used by anohter process and not allow me to delete.
string appPath = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) + @"\screenshots\";
string schemename = selectedStockObject.Name.ToString();
objSchemeBLL = new SchemeBLL();
Scheme objTemp = objSchemeBLL.getSchemebyName(schemename);
GC.Collect();
Thread.Sleep(20);
File.Delete(objTemp.ImgPath);
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Basic C# program
datalist gallery