PeerCollaboration::GetLocalRegisteredApplications Method
Gets a collection of PeerApplication objects that are registered on the local machine.
Assembly: System.Net (in System.Net.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | GetLocalRegisteredApplications() | Gets all PeerApplication objects that are registered on the local machine. |
![]() ![]() | GetLocalRegisteredApplications(PeerApplicationRegistrationType) | Gets a collection of all PeerApplication objects that are registered on the local machine for the specified PeerApplicationRegistrationType. |
A PeerApplicationCollection that contains applications that are registered on the local machine. If an application is not found, a collection of size zero (0) is returned.
The caller required to sign in to the peer collaboration infrastructure via the SignIn method or prior to the use of this method.
Access to this property requires a PermissionState of Unrestricted. This state is created when the Peer collaboration session begins.
The following example code illustrates how to retrieve a collection of applications registered with the Collaboration infrastructure:
// Enumerating all local registered applications. private static void EnumLocalRegisteredApplications() { PeerApplicationCollection pac = null; Console.WriteLine("Attempting to enumerate all local registered collaboration applications..."); try { pac = PeerCollaboration.GetLocalRegisteredApplications(PeerApplicationRegistrationType.AllUsers); foreach (PeerApplication pa in pac) { Console.WriteLine("Registered application:\n ID: {0}\n Description: {1}\n", pa.Id, pa.Description); } } catch (PeerToPeerException p2pEx) { Console.WriteLine("The Peer Collaboration Infrastructure could not return an enumeration of the registered applications: {0}", p2pEx.Message); } catch (Exception ex) { Console.WriteLine("Unexpected exception caught when trying to enumerate the registered collaboration applications: {0}.", ex.Message); } finally { foreach (PeerApplication pa in pac) { pa.Dispose(); } } return; }

