PeerName Constructor (String, PeerNameType)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Initializes a new instance of the PeerName class.

Namespace:   System.Net.PeerToPeer
Assembly:  System.Net (in System.Net.dll)

public PeerName(
	string classifier,
	PeerNameType peerNameType


Type: System.String

String that contains the Peer Name to encode as a PeerName.

Type: System.Net.PeerToPeer.PeerNameType

PeerNameType enumeration value that specifies the type of peer name to create.

Exception Condition

The Classifier includes one or more illegal characters.


One or more parameters are null.

  • The Default Identity used as the basis of the PeerName could not be retrieved.

  • The PeerName could not be created.

This constructor returns an object of type PeerName that contains the fully qualified name of the peer. It also specifies whether the peer name is secured or unsecured.

This instance uses the default peer identity for the current user and the specified Classifier, in addition to the type of peer name to create with the specified classifier and type.

.NET Framework
Available since 3.5
Return to top