PDA

View Full Version : حذف فایل



sajjad1365
یک شنبه 17 آبان 1388, 20:11 عصر
سلام. ایا برای حذف یک فایل این کد درسته:
Private Declare Function CopyFile Lib "kernel32" Alias "deleteFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long


DELETEFile Text1.Text, 0
در تکست نام فایل هست.
اگه درسته چرا کار نمیکنه؟
اگر نه یه راه حل بگین.
ممنون

Felony
یک شنبه 17 آبان 1388, 20:33 عصر
Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
این دستور کپی چه ربطی به حدف فایل داشت ؟

میتونی از kill استفاده کنی .

sajjad1365
یک شنبه 17 آبان 1388, 20:41 عصر
ببخشید کد اینه:
Private Declare Function deleteFile Lib "kernel32" Alias "deleteFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long

xxxxx_xxxxx
یک شنبه 17 آبان 1388, 21:08 عصر
تابع رو به این شکل تعریف کنید و تنها آدرس کامل فایل رو بهش بدید:


Private Declare Function deleteFile Lib "kernel32" Alias "DeleteFileA" (ByVal lpFileName As String) As Long