1

我有这个代码:

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()

如何从此路径中删除此文本文件?

4

1 回答 1

3

您可以执行以下操作来获取路径:

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

然后在关闭文件后删除文件:

File.Delete(fullPath)
于 2013-10-23T15:51:47.587 回答