TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
8
524
Delete files through a button.
Jan 30 2020 12:39 AM
Hello I need some help with deleting files .txt through a button with windows forms. Because when I try to do this, I'm getting this error when trying to delete.
Error is: file is being used in a process..... etc. So I can't delete the file.
Code is very simple: File.Delete(textBox1.Text);
Watched an tutorial and followed it, but it wont let me delete the files.
And I have this code too:
if(dlg.ShowDialog() == DialogResult.OK) {
StreamReader reader = new StreamReader(dlg.FileName, Encoding.Default);
textBox1.Text = dlg.FileName;
}
if this will help.
Could anyone help me?
Reply
Answers (
4
)
save xml file where the setup installed.
c# in windows form