Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3352344
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:01:07+00:00 2026-05-18T02:01:07+00:00

I have to copy some file from server to another, I thought to use

  • 0

I have to copy some file from server to another, I thought to use File.Copy but how I specify there the location of a file ? and also there can be a password identification on from and to.

Any ideas ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:01:07+00:00Added an answer on May 18, 2026 at 2:01 am

    If these are two servers on the same local network and you have appropriate access permissions, you can probably get by using the File.Copy method, and passing whatever path you would normally use to access the network share in Windows Explorer (this is probably a UNC path, like \\TheRemoteServer\SharedFolder\MyFiles). If you can copy the file in Explorer, the File.Copy method will more than likely succeed also.

    However, if you need to authenticate as a different user on the remote server to have the appropriate permissions to copy files, things get a little more complicated because there is no easy .NET API for this. You might look into this answer to another question. Essentially, it p/invokes to log on to the remote machine as a different user. Once you’re logged on, you can perform the file copy normally.

    Also see this question: Accessing a Shared File (UNC) From a Remote, Non-Trusted Domain With Credentials—chiefly the answer that suggests using WNetUseConnection to connect to a UNC path on a remote machine with authentication.

    Finally, just as a precaution, I feel like I must point out that whenever you start doing network file copies, you need to be very careful to check the availability of the network path before you just blindly start copying (the remote server could be down, the local machine could have lost its connection to the network, etc.). You might also need to consider handling cases where the network operation times out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some methods that call File.Copy, File.Delete, File.Exists, etc. How can we test
I have to copy quite a lot of files from one folder to another.
I have to copy a bunch of data from one database table into another.
I have a copy of emacs that I use on a couple of different
I have taken a copy of a database home with me so I can
I have been able to copy the raw data from an otherwise inaccessible USB
I am trying to export a WAR file from Eclipse. I have a Dynamic
I need to pull some BLOB data from a SQL Server 2005 database and
I have a working copy of my project, checked out using Subversion 1.5.1. When
I have an encryption/copy protection question. I'm writing an application for a company that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.