Reputation: 17298
i can get file name via below codes. How can i send this file to remote computer. this remote computer ip: 192.168.2.105 also i can use 51124 port
class Program
{
static void Main(string[] args)
{
string[] dosyalarinYollari = System.IO.Directory.GetFiles(@"z:\20071008\1.2.392.200036.9116.2.6.1.48.1215563310.1191800303.305777\", "*.dcm", System.IO.SearchOption.AllDirectories);
foreach (string s in dosyalarinYollari)
{
Console.Write(s+"\n"); // i need to send tihs s file to remote machine
}
Console.ReadKey();
}
}
Upvotes: 0
Views: 4380
Reputation: 41318
There isn't nearly enough information here to give you a definitive answer, but I can mention some approaches. There are many ways to transfer files between computers, each with pros and cons.
\\ipaddress\share\filename.
Some solutions are easier than others. Some require the target machine to be running a server. Some are Windows only, Unix only, etc, etc.
Can you give us more information on your environment, why you need to do this, etc.
Upvotes: 5
Reputation: 4781
a simple File.Copy passing the location as @"\[ip][drive]$[folder]" is enough to send it to a remote computer if you have rights to log on to that computer.
i'm not really sure about the location string.
Upvotes: 1