PeerCollaboration.GetLocalRegisteredApplications メソッド

定義

ローカル コンピューターに登録されている PeerApplication オブジェクトのコレクションを取得します。

オーバーロード

名前 説明
GetLocalRegisteredApplications()

ローカル コンピューターに登録されているすべての PeerApplication オブジェクトを取得します。

GetLocalRegisteredApplications(PeerApplicationRegistrationType)

指定したPeerApplicationRegistrationTypeのローカル コンピューターに登録されているすべてのPeerApplication オブジェクトのコレクションを取得します。

次のコード例は、コラボレーション インフラストラクチャに登録されているアプリケーションのコレクションを取得する方法を示しています。

// 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;
}

注釈

呼び出し元は、 SignIn メソッドを使用するか、このメソッドを使用する前に、ピア コラボレーション インフラストラクチャにサインインする必要があります。

このプロパティにアクセスするには、 PermissionStateUnrestrictedが必要です。 この状態は、 Peer コラボレーション セッションの開始時に作成されます。

GetLocalRegisteredApplications()

ローカル コンピューターに登録されているすべての PeerApplication オブジェクトを取得します。

public:
 static System::Net::PeerToPeer::Collaboration::PeerApplicationCollection ^ GetLocalRegisteredApplications();
public static System.Net.PeerToPeer.Collaboration.PeerApplicationCollection GetLocalRegisteredApplications();
static member GetLocalRegisteredApplications : unit -> System.Net.PeerToPeer.Collaboration.PeerApplicationCollection
Public Shared Function GetLocalRegisteredApplications () As PeerApplicationCollection

返品

ローカル コンピューターに登録されているすべてのアプリケーションを含む PeerApplicationCollection 。 アプリケーションが見つからない場合は、サイズ 0 のコレクションが返されます。

例外

このメソッドがこのピアに登録されているアプリケーションを列挙しようとしたときに、無効な値が返されました。 すべてのアプリケーションに有効なレジストリ値があることを確認してください。

注釈

呼び出し元は、このメソッドを使用する前に、 SignIn メソッドを使用してピア コラボレーション インフラストラクチャにサインインする必要があります。

このプロパティにアクセスするには、 PermissionStateUnrestrictedが必要です。 この状態は、 Peer コラボレーション セッションの開始時に作成されます。

こちらもご覧ください

適用対象

GetLocalRegisteredApplications(PeerApplicationRegistrationType)

指定したPeerApplicationRegistrationTypeのローカル コンピューターに登録されているすべてのPeerApplication オブジェクトのコレクションを取得します。

public:
 static System::Net::PeerToPeer::Collaboration::PeerApplicationCollection ^ GetLocalRegisteredApplications(System::Net::PeerToPeer::Collaboration::PeerApplicationRegistrationType type);
[System.Security.SecurityCritical]
public static System.Net.PeerToPeer.Collaboration.PeerApplicationCollection GetLocalRegisteredApplications(System.Net.PeerToPeer.Collaboration.PeerApplicationRegistrationType type);
[<System.Security.SecurityCritical>]
static member GetLocalRegisteredApplications : System.Net.PeerToPeer.Collaboration.PeerApplicationRegistrationType -> System.Net.PeerToPeer.Collaboration.PeerApplicationCollection
Public Shared Function GetLocalRegisteredApplications (type As PeerApplicationRegistrationType) As PeerApplicationCollection

パラメーター

type
PeerApplicationRegistrationType

PeerApplicationRegistrationType 指定したアプリケーションに対して戻ります。

返品

ローカル コンピューターに登録されている、指定したtypeのすべてのアプリケーションを含むPeerApplicationCollection。 アプリケーションが見つからない場合は、サイズ 0 のコレクションが返されます。

属性

例外

type パラメーターは、PeerApplicationRegistrationType列挙型の既知の値に設定されていません。

このメソッドがこのピアに登録されているアプリケーションを列挙しようとしたときに、無効な値が返されました。 すべてのアプリケーションに有効なレジストリ値があることを確認してください。

注釈

呼び出し元は、このメソッドを使用する前に、 SignIn メソッドを使用してピア コラボレーション インフラストラクチャにサインインする必要があります。

このメソッドにアクセスするには、 PermissionStateUnrestrictedが必要です。 この状態は、 Peer コラボレーション セッションの開始時に作成されます。

こちらもご覧ください

適用対象