I want to make a WinForms application that can copy files over a local network. Using File.Copy seems like an easy way to do this. The example below shows how to copy a file to another directory on the same computer. How can I use File.Copy to copy files from one computer to another that belongs to the same LAN?
you may try
File.Copy(@"\\server\sourceFileFolder\file1", @"\\server2\destinationFileFolder\file1");
also be sure to use the UNC path. Here are some links. - Link - Link - Link
Something like that
File.Copy( "C:\path\yourfile.txt", "\\remote_hostname\path\destinationfile.txt");
try it
File.Copy(@"\\server\folder$\test.txt", "test.txt");
' code in Vb , convert it into C# Dim findDirectory = "D:\UOLQserver\Data\Sound\" Dim Y_N = System.IO.Directory.Exists(findDirectory) If Y_N = True Then Else Directory.CreateDirectory(findDirectory) End If Dim MyFilename1 = findDirectory & "\" & Today.Day & "-" & Today.Month & "-" & Today.Year & "-" & tineNow & "-" & Today.Minute & ".wav" FileCopy("\\SERVER\D$\UOLQserver\Data\Sound\test.wav", MyFilename1)
Source: https://habr.com/ru/post/908300/More articles:How to convert bitmap to byte array in Mono for Android - androidChange Java screen resolution - java"PHP Fatal error: call to undefined function mssql_select_db () in c: \ ... appscript.php on line 16" - phpDoes the html5 "pattern" attribute work in every browser? - html5How to configure page code encoding? - phpPython: IndexError: index index out of range - pythonCall vb6 dll from C # - c #How can I access a shared dictionary with multiprocessing? - pythonJavaFx 2.0 Game Engines / Frameworks - How will JavaFx 2.0 change Java games? - javaReading and writing an XML file - androidAll Articles