Hi all,
i've created a module to use some own web methods. Everything is working fine eexcept one thing.
In my method i've created a file:
Dim newFileWriter As IO.FileStream = Nothing
newFileWriter = New IO.FileStream(destFilePath, IO.FileMode.Create, IO.FileAccess.Write)
newFileWriter.Write(bytes, 0, bytes.Length)
newFileWriter.Flush()
newFileWriter.Close()
newFileWriter.Dispose()
newFileWriter = Nothing
This part is working fine.
At the end of my method i want to delete this file:
Dim filename As String = Path.Combine(dataPath, objZipEntry.Name)
If IO.File.Exists(filename) = True Then
Try
FileSystemUtils.DeleteFile(filename)
'// or this version ->IO.File.Delete(filename)
Catch ex As Exception
Return "Could not delete destination File:" + filename + vbCrLf + "error:" + ex.Message
End Try
End If
On thi part i will get the following error: "The process cannot access the file 'C:\Inetpub\DotNetNuke\Portals\0\DatabaseUploads\ADRESSE.xml' because it is being used by another process."
I don't know where the prodblem ist. Can anybody help ?