我有这段代码:
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()
如何从此路径中删除此文本文件?
答案 0 :(得分:3)
你可以做这样的事情来获得路径:
Dim fullPath as String = ((FileStream)(WriterDay1.BaseStream)).Name
然后在文件关闭后删除该文件:
File.Delete(fullPath)