Winforms and Impersonation

emitrebel

Newcomer
Joined
Oct 6, 2005
Messages
3
I'm building a Windows app and I'm stumped on a simple copy operation. Here is the scenerio:

I want to copy c:\temp\somefile.txt to \\remoteserver\c$\temp\somefile.txt
Now my local machine is on one domain and the remote server is on another domain. Typically when you use Windows Explorer to copy you get prompted for your remote domain credentials. No problem, I'm an admin on the remote domain.

I've tried:
fso.copyfile <- This doesn't allow for remote credentials
wmi <- Provides remote credentials however no UNC's
system.io.file.copy <- Uses local credentials

I would prefer to use system.io.file.copy. How do I provide remote credentials through my application?
Note: This is a Windows application NOT ASP.
 
Fixed my own problem.

I recently started running my copy operation in a new thread (copying files to several servers at a time). That is when the authentication started failing. I've implemented a "per thread" authentication and it is now working.
 
Back
Top