System.UnauthorizedAccessException Access to the path "Filename" is denied.

B

bannp

Hi All,

I have a windows Application in vb.net. I have a file copy function the
program copies a file from a network share to a temp directory on the
local machine then launchs this file from the Temp directory. When the
program executes it raises the above exception when copying the file.
Everyone has full control of the network share.


Public Function ViewFileRecord(ByVal sGuid As String)
PropProperties(sGuid)
Try
If File.Exists(sPathTarget) Then
File.Delete(sPathTarget)
End If

File.Copy(sPathSource, sPathTarget, True)
AttachProgTypes(sExtnFile)
Exit Function
Catch eFile As FieldAccessException
ExceptionMessage(eFile)
End Try
End Function

Any body any ideas.

Thanks,

Pete.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top