문제

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?

도움이 되었습니까?

해결책

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)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top