Just to be clear, I've pasted the message below. I'm doing:
IF IO.File.Exists(filePath) then io.File.Delete(filePath)
It pukes. I know it's security. What I'm trying to do is download a file. I want it to overright the file. (Version checking is done already.) I'm sure it's something I'm missing. What can I check?
Here's the message, just to be clear.
System.UnauthorizedAccessException: Access to the path "C:\Documents and Settings\mark.CENTURYCOLOR\My Documents\Visual Studio Projects\Data.Match\bin\DataMatch.exe" is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.File.Delete(String path)
at DataMatchUpdater.DmUpdater.WriteFiles() in C:\Documents and Settings\mark.CENTURYCOLOR\My Documents\Visual Studio Projects\DataMatchUpdater\DMUpdater.vb:line 187
Rhett Gong [MSFT] - 29 Jul 2004 08:43 GMT
Hi,
From your description, this file is a local file (not readonly) and you have all
permissions to it. And you get this exception when you are trying to delete a file
which you are downloading at the same time.
From your exception msg, we can see that the msg is throwed by WriteFiles. From call
stack, I assume that you write this function and you are trying to write something to
the file. Could you add an assert before the WriteFiles to see if the file exists? If
this file is created after the original file is deleted. I suggest you checking the
permission of the newly created file before going to WriteFiles.
Please let me know what you get after apply this. Thanks.
Best regards,
Rhett Gong [MSFT]
Microsoft Online Partner Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.