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

  • Thread starter Thread starter bannp
  • Start date Start date
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.
 
Back
Top