Question Accessing files across a network

!Blue

New member
Joined
Apr 16, 2010
Messages
1
Programming Experience
10+
I thought this would be a simple task - and maybe it is - but having spent a few days trawling through the .Net documentation I haven't been able to
find classes/functions to acheive the result simply... so I'm hoping someone can help me here.

What I want to do is copy a file from another machine on the local network to my machine using .Net code - the catch being a username & password is required.

So a function like

File.Copy(uncPath,myMachinePath,username,password)

would be just perfect... (if it existed..?)

I also wish to trap any errors such as incorrect parameters...

The other machines on the network are under test and therefore are not allowed to have any code added to them, or altered in any way (such as adding shared folders)

I've looked at the FileWebRequest class - not sure if this was a posibility - but the documentation says that the Credentials property of this is
never used - so it's a non starter.

I've noticed there's a MapNetworkDrive(<parameters>,username,password) function in VBScript and thought it may be a way forward, but cannot find it's equivilent in .Net

There is no gaurentee that the other machines will have an ftp server.

I've also noticed there's a WindowsIdentity.Impersonate function - but this looks quite complex to use and I find it hard to believe there is not a simplier way forward

My development environment is 2003 - .Net 1.1

Any pointers as to what classes/functions to use to acheive this in the simplest way - gratefully recieved.
 
Back
Top