C++ Networking

Hello everyone, my question is how could I transfer a .txt file from Computer A to Computer B using c++. (over LAN)

Please go easy cause I am new pretty new to C++ and very new to networking. (atleast point me in the direction) Thnx ahed of time for all the answers
Why not just use FTP?
I think it depends on the OS you are using.
In Windows, you could use CopyFile:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363851%28v=vs.85%29.aspx

Example:
CopyFile("\\\\A\\shared_folder\\example.txt", "\\\\B\\shared_folder\\example.txt", FALSE);
where A and B are the computer names and "shared_folder" is the name of the shared folder on the two computers.
Obviously, you must have read permissions on "\\A\shared_folder" and write permissions on "\\B\shared_folder".
Topic archived. No new replies allowed.