I am using file.copy()
method to copy a file from source directory to destination directory in my vb.net windows application. and I am getting below error:
Access to path '\sample\windows\path' is denied.
Try
If File.Exists(sourcepath) Then
File.SetAttributes(sourcepath, FileAttributes.Normal)
End If
If Not Directory.Exists(dest) Then
Directory.CreateDirectory(dest)
End If
File.Copy(sourcePath, destPath, True)
Catch ex As Exception
System.Windows.MessageBox.Show(ex.Message)
End Try
Although I am able to access the specified windows path.I am running application with administrator privileges still i am getting this error.What can be the reason for this error.