Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

we are using 3 servers in our current project.our webserver is running on say 'Server A'.
our requirement is when user click a particular button.a file must be transferred from 'Server B' to 'Server C'.and we have to get the feedback of the operation to 'server A'
.we are not allowed to install anything on 'Server B'.How can i implement this functionality using c#..please suggest any ideas

Thanks,

What I have tried:

i created a shared folder in 'Server B' and placed a sample file there.to copy this file from 'Server B' can we use cmd commands ?.
Posted
Updated 22-Aug-16 23:35pm

1 solution

You can use System.IO classes like File to copy files

File.Copy Method (System.IO)[^]

create shares on the target\destination servers and copy the files between them, so from "\\servera\myshare\myfile.txt" to "\\serverb\myshare\myfile.txt" or whatever. Your biggest issue is going to be security, the account your .net code runs under will need access to all of these shares and by default the account used won't. You'll need to create an account with the desired access and configure IIS to use that account rather than the default one.

Configure the Anonymous Authentication Identity (IIS 7)[^]

Or you can leave it running as the app pool user and change the user the app pool uses (try saying that 10 times fast).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900