ReidarT,
You can't really give yourself permissions if you don't have them
already.
You can use the FileIOPermission class to determine whether or not you
have the permission (based on where your app was loaded from).
What you would do is create an instance of the FileIOPermission
instance, passing the complete paths of the file names you want to move
(with read access for the file being copied, and write access for the file
being copied to).
Once you have that, you can call Demand on the permission, and it will
throw a security exception if the framework will permit you to make the
call.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"ReidarT" <re****@eivon.no> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am copying a file from a network drive to a local PC.
Could someone give me a short example on how to get permission to copy the
file from R: to C:
I have figured out that if I use
Imports System.Security.Permissions
and
Dim oFp As FileIOPermission = New _
FileIOPermission(FileIOPermissionAccess.AllAccess, "R: ....
Am I on the track?
regards
reidarT