File Transfer Peer to Peer C #

Hey, I'm looking at google and I can’t find anything about what is happening with peer to peer.

Basically, I want to be able to send a file from my computer to another computer. Does anyone know any guides that can help me?

Thanks.

+7
c # transfer peer
source share
4 answers

If you really want to "send a file from my computer to another computer" using C #, you may not look for true p2p. You can just use raw TCP. To do this, you need the remote computer to listen to the connection, the computer opens a connection to the remote computer and starts sending data.

Here is a very simple example of how to do something like here .

If you are really looking for true P2P, you better use the existing P2P network (otherwise there will be nobody on your computer except you and your other computer). There are several C # BitTorrent libraries - for example, BitSharp , TorrentNet . There is a whole question about BitTorrent libraries written in pure C # .

+3
source share

Google "System.Net.PeerToPeer" is the namespace available in the .NET 3.5 environment. You can easily find the documents and sample code.

+6
source share

If the destination computer can open the URI for publication, you can simply use

WebClient.UploadFile(Uri address, string filename) 

It just simply requires a URI as an address (http, ftp, even a file protocol for transferring to a folder).

But this requires setting up the server side for publishing, but it will be platform independent on the server (for example, any old FTP server or web page or service that accepts a file using the POST method). However, security can be a problem to consider.

This is the use of the push model. WebClient can also be used on the other hand to download. It also supports the transfer of data streams, strings, etc.

+3
source share

Take a look at this project on Project Code .

It provides P2P sharing and file transfer and can be either an inspiration or a solution.

0
source share

All Articles