1

I have this code:

Dim WriterDay1 As New System.IO.StreamWriter("C:\Users\IOSEagle\Desktop\My Projects\Microsoft Visual Basic 2010\Form\Programes\MyAlarm\MyAlarm\RepeatDays\Monday.txt")
WriterDay1.Write(MondayCheckBox.Text)
WriterDay1.Close()

How can I delete this text file From this path?

Ňɏssa Pøngjǣrdenlarp
  • 38,411
  • 12
  • 59
  • 178
Mousa Alfhaily
  • 1,260
  • 3
  • 20
  • 38

1 Answers1

3

You could do something like this to get the path:

Dim fullPath as String = ((FileStream)(WriterDay1.BaseStream)).Name

And then delete the file after it is closed with this:

File.Delete(fullPath)
Gobo
  • 687
  • 1
  • 6
  • 16