Home All Groups Group Topic Archive Search About
Author
24 Oct 2006 8:01 PM
5bp
Hi,

Hopefully Ive posted this correctly.  I have a small app that loops through
a directory to copy files to another server.  (This is fine)

The directory on the other server has been secured with only certain users
allowed access. 

I use the file.move command in vb.net to move the files how can I pass a
username and password with the command to allow the file(s) to be moved to
the directory on the server ?

TIA

Author
24 Oct 2006 10:02 PM
Claus Konrad
You can't.
When dealing with OS security (NTFS), you need to authenticate to the
drive/folder using your windows credentials.

Therefore, make sure that the Account under which your app. runs, has the
appropriate NTFS rights to write to the drive. If the account is lackign
these permissions, you are left with the option of impersonating an account
that does have write access to the folder.
And do make sure, in that case, that you revert
(ImpersonationContext.Undo()) this immediately upon copying. Put this in a
finally block to make sure it is called.

--
rgds.
/Claus Konrad


Show quoteHide quote
"5bp" wrote:

> Hi,
>
> Hopefully Ive posted this correctly.  I have a small app that loops through
> a directory to copy files to another server.  (This is fine)
>
> The directory on the other server has been secured with only certain users
> allowed access. 
>
> I use the file.move command in vb.net to move the files how can I pass a
> username and password with the command to allow the file(s) to be moved to
> the directory on the server ?
>
> TIA