程式開發筆記簿 program.maomo.info
刪除檔案
[VB.NET]
Dim FilePath As String = "F:\Uploads\test.txt" '檔案路徑
If File.Exists(FilePath) Then  '若檔案存在,則刪除檔案 
     File.Delete(FilePath)
End If


[C#]
String FilePath = "F:\\Uploads\\test.txt"; //檔案路徑
if (File.Exists(FilePath))  //若檔案存在,則刪除檔案
{
    File.Delete(FilePath);
}
Edit: 2010/07/28 16:35:22   View: 251

發表回應

大名:
E-Mail:
網址:
回應內容:
驗證碼:
回首頁 連絡阿毛 & 交流建議
© 2007-2010, 程式開發筆記簿 program.maomo.info
程式設計 & 網站建置: Vicky Chien 寄信給阿毛