In c# 2008, I'm trying to copy a file to a destination path (for example \newserver\destinationFolder), that can be in another domain or using a different username/password than the current user. How can I specify these new network credentials before doing the File.Copy(...) ?
Thank you!
Good question but I dont think this is possible. I believe this type of file copy from one domain to another ( where there is not a trust set up) would be considered security hole.
Some options:
Look at LogonUser. Here's the pinvoke page for it:
http://www.pinvoke.net/default.aspx/advapi32.logonuser
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With