from //build/ 2011
Proximity sample
// OPTIONAL: Set some custom name to identify self to others.
PeerFinder.displayName = myNameToDisplay;
PeerFinder.ConnectionRequested += new TypedEventHandler<object,
ConnectionRequestedEventArgs>(PeerConnectionRequested);
PeerFinder.Start(); // Start advertising.
private async void PeerConnectionRequested(object sender,
ConnectionRequestedEventArgs args) {
PeerInformation peer = args.PeerInformation;
rootPage.NotifyUser("Connection requested from peer " +
peer.DisplayName);
// ... Confirm as appropriate ...
StreamSocket socket = await PeerFinder.ConnectAsync(peer);
}
using Windows.Networking.Proximity;
IReadOnlyList<PeerInformation> peerList;
// OPTIONAL: Set some custom name to identify self to others.
Windows.Networking.Proximity.PeerFinder.displayName = myNameToDisplay;
PeerFinder.Start(); // Must be done before FindAllPeersAsync().
peerList = await PeerFinder.FindAllPeersAsync(); // Scan for ~1 second.
// ... Use peerList[index].displayName to select index ...
StreamSocket socket = await PeerFinder.ConnectAsync(peerList[index]);
PeerFinder.Stop(); // Done with discovery.
Developing connected applications
Webcam
Encrypt
Socket
Socket
Decrypt
File
Mic
Compress
Speakers
File
Decompress
Video
control
…
…
…
StreamSocket connectedSocket;
StorageFile file;
// Get stream from file.
var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite);
await RandomAccessStream.CopyAsync(connectedSocket.InputStream,
fileStream);
StreamSocket connectedSocket;
StorageFile file;
// Get stream from file.
var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite);
await RandomAccessStream.CopyAsync(connectedSocket.InputStream,
fileStream);
StreamSocket connectedSocket;
StorageFile file;
// Get stream from file.
var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite);
var decompressor = new Windows.Storage.Compression.Decompressor(
connectedSocket.InputStream);
await RandomAccessStream.CopyAsync(decompressor,
fileStream);
StreamSocket connectedSocket;
StorageFile file;
// Get stream from file.
var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite);
var provider = new Windows.Security.Cryptography.DataProtection.
DataProtectionProvider();
await provider.UnprotectStreamAsync(connectedSocket.InputStream,
fileStream);
How to enable loopback and troubleshoot network isolation (Windows Store
apps)
[785] Creating connected apps that work on today's
networks
Proximity sample
[580] Building Windows runtime sockets apps
Developing connected applications
[581] Making apps social and connected with
HTTP services
How to enable loopback and troubleshoot
network isolation
[329] Understanding Wi-Fi Direct in Windows 8
[588] Debugging Connected Apps
[863] Delivering notifications with the Windows
Push Notification Service and Windows Azure
http://msdn.microsoft.com/enUS/windows/apps/br229512
http://design.windows.com/
http://code.msdn.microsoft.com/windows
apps/Windows-8-Modern-Style-AppSamples
http://channel9.msdn.com/Windows
http://aka.ms/BuildSessions
© Copyright 2026 Paperzz