Mahdi-v
چهارشنبه 21 آبان 1393, 00:07 صبح
عرض سلام و ادب خدمت اساتید محترم
ببخشید من در حذف کردن فایل در هارد کامپیوتر با وی بی دات نت مشکل دارم !!!!!!!!!!!! هر چی کد مینویسم یه ارور میده که برام عجیبه
My.Computer.FileSystem.DeleteFile("C:\test.txt")
یا مثلا این
'Specify file to delete
Dim myfile As String = "C:\test.txt"
'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Delete it!
Dim fi As New FileInfo(myfile)
fi.Delete()
'Delete succesful message
MessageBox.Show("File deleted!", "www.interloper.nl", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
'File not found error
MessageBox.Show("File couldnt be found. Make sure the file C:\test.txt exists!", "www.interloper.nl", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
اما این ارورو میده
Access to the path 'C:\test.txt' is denied.
لطفا کمکم کنید
ببخشید من در حذف کردن فایل در هارد کامپیوتر با وی بی دات نت مشکل دارم !!!!!!!!!!!! هر چی کد مینویسم یه ارور میده که برام عجیبه
My.Computer.FileSystem.DeleteFile("C:\test.txt")
یا مثلا این
'Specify file to delete
Dim myfile As String = "C:\test.txt"
'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Delete it!
Dim fi As New FileInfo(myfile)
fi.Delete()
'Delete succesful message
MessageBox.Show("File deleted!", "www.interloper.nl", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
'File not found error
MessageBox.Show("File couldnt be found. Make sure the file C:\test.txt exists!", "www.interloper.nl", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
اما این ارورو میده
Access to the path 'C:\test.txt' is denied.
لطفا کمکم کنید