Beruflich Dokumente
Kultur Dokumente
Table of Contents
Introduction
Overview
Table of Figures
Figure 1: New Visual C# and Visual Basic Windows Form Application
Figure 10: Two instances of the application connected to the same network
Introduction
This Peer to Peer (P2P) sample application demonstrates many of the ways to use
the new Peer Channel technology. Peer Channel is part of Windows Communication
Foundation (WCF), which makes it possible to join hundreds of computers to a P2P
network.
Peer Channel is inherently a multicast channel, so data sent by one node is received
by all nodes in the network. Peer Channel reduces the complexity of creating and
joining networks, and maintaining an appropriate number of connections between
nodes. It also automatically handles additional complexities, such as nodes leaving
the network and causing the network to divide, so it’s much easier to build
applications that include collaboration and sharing data between computers.
Overview
This document demonstrates how to use the C4F P2P components to build a picture
sharing application that uses P2P to send pictures from one computer to another.
Visual Basic
Figure 1: New Visual C# and Visual Basic Windows Form Application
3. In the Toolbox pane, click the plus sign (+) next to C4F Vista P2P Tools
(WinForms) to expand the group.
Figure 2: The Toolbox pane
Note If the tool doesn’t fit on the design surface, drag the edges of the
design surface to resize it.
Figure 3: NetworkManager on the design surface
6. On the design surface, click NetworkManager to select it, and then open the
SmartTag by clicking the arrow in the upper right corner of the tool.
Figure 5: NetworkManager SmartTag
7. In the NetworkManager Tasks dialog box, click the arrow next to the
Picture Control drop-down list, and then select PictureControl1.
Figure 6: Selecting the Picture Control
9. In the application window, enter a user name, password, and network name,
and then click Join.
Figure 7: Joining the application to a network
Note If you are the only user joined to the network, you can test the
connection by opening another instance of the application and joining both
instances to the same network. For more information, see To test the
connection of a P2P Windows Form picture application.
2. In the application window, type a user name, password, and network name,
and then click Join.
3. Open Windows Explorer and browse to the location that the project being is
saved in (for example, C:\code\p2p). Open the project folder, open the bin
folder, open the Debug folder, and then double-click the executable.
4. In the second application window, type a user name, password, and network
name, and then click Join.
Note To join both instances of the application to the same network, you
must use the same password and network name.
5. In the first application window, click Select Picture to Send, and then
browse to and select a picture to send. The picture appears in the in the
second application window.
Figure 10: Two instances of the application connected to the same network