SocketPermission.AcceptList プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SocketPermission.AcceptList プロパティの意味・解説 

SocketPermission.AcceptList プロパティ

このアクセス許可インスタンス制約下で受け入れられるエンドポイント識別する EndpointPermission インスタンスの一覧を取得します

名前空間: System.Net
アセンブリ: System (system.dll 内)
構文構文

Public ReadOnly Property
 AcceptList As IEnumerator
Dim instance As SocketPermission
Dim value As IEnumerator

value = instance.AcceptList
public IEnumerator AcceptList { get; }
public:
property IEnumerator^ AcceptList {
    IEnumerator^ get ();
}
/** @property */
public IEnumerator get_AcceptList ()
public function get AcceptList
 () : IEnumerator

プロパティ
EndpointPermission インスタンス格納している IEnumerator インターフェイス実装するインスタンス

使用例使用例

AcceptList プロパティ使用して受信特権付与されているエンドポイントリスト返すコード例次に示します

' Creates a SocketPermission restricting access to and from all URIs.
Dim mySocketPermission1 As New
 SocketPermission(PermissionState.None)

' The socket to which this permission will apply will allow connections
 from www.contoso.com.
mySocketPermission1.AddPermission(NetworkAccess.Accept, TransportType.Tcp, "www.contoso.com",
 11000)

' Creates a SocketPermission which will allow the target Socket to connect
 with www.southridgevideo.com.
Dim mySocketPermission2 As New
 SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "www.southridgevideo.com",
 11002)

' Creates a SocketPermission from the union of two SocketPermissions.
Dim mySocketPermissionUnion As SocketPermission
 = CType(mySocketPermission1.Union(mySocketPermission2), SocketPermission)

' Checks to see if the union was successfully created by using the IsSubsetOf
 method.
If mySocketPermission1.IsSubsetOf(mySocketPermissionUnion) And
 mySocketPermission2.IsSubsetOf(mySocketPermissionUnion) Then
   Console.WriteLine("This union contains permissions from both
 mySocketPermission1 and mySocketPermission2")
   
   ' Prints the allowable accept URIs to the console.
   Console.WriteLine("This union accepts connections on :")
   
   Dim myEnumerator As IEnumerator = mySocketPermissionUnion.AcceptList
   While myEnumerator.MoveNext()
      Console.WriteLine(CType(myEnumerator.Current, EndpointPermission).ToString())
   End While
   
   Console.WriteLine("This union establishes connections on :
 ")
   
   ' Prints the allowable connect URIs to the console.
   Console.WriteLine("This union permits connections to :")
   
   myEnumerator = mySocketPermissionUnion.ConnectList
   While myEnumerator.MoveNext()
      Console.WriteLine(CType(myEnumerator.Current, EndpointPermission).ToString())
   End While
End If 
// Creates a SocketPermission restricting access to and from all URIs.
SocketPermission mySocketPermission1 = new SocketPermission(PermissionState.None);

// The socket to which this permission will apply will allow connections
 from www.contoso.com.
mySocketPermission1.AddPermission(NetworkAccess.Accept, TransportType.Tcp, "www.contoso.com",
 11000);

// Creates a SocketPermission which will allow the target Socket to
 connect with www.southridgevideo.com.
SocketPermission mySocketPermission2 =
                           new SocketPermission(NetworkAccess.Connect,
 TransportType.Tcp, "www.southridgevideo.com", 11002);

// Creates a SocketPermission from the union of two SocketPermissions.
SocketPermission mySocketPermissionUnion = 
                           (SocketPermission)mySocketPermission1.Union(mySocketPermission2);

// Checks to see if the union was successfully created by using the
 IsSubsetOf method.
if (mySocketPermission1.IsSubsetOf(mySocketPermissionUnion) &&
 
       mySocketPermission2.IsSubsetOf(mySocketPermissionUnion)){
     Console.WriteLine("This union contains permissions from both mySocketPermission1
 and mySocketPermission2"); 

     // Prints the allowable accept URIs to the console.
     Console.WriteLine("This union accepts connections on :");

     IEnumerator myEnumerator = mySocketPermissionUnion.AcceptList;
  while (myEnumerator.MoveNext()) {
          Console.WriteLine(((EndpointPermission)myEnumerator.Current).ToString());
       }      

        // Prints the allowable connect URIs to the console.
     Console.WriteLine("This union permits connections to :");

     myEnumerator = mySocketPermissionUnion.ConnectList;
  while (myEnumerator.MoveNext()) {
          Console.WriteLine(((EndpointPermission)myEnumerator.Current).ToString());
       }      

      }

// Creates a SocketPermission restricting access to and from all URIs.
SocketPermission^ mySocketPermission1 = gcnew SocketPermission( PermissionState::None
 );

// The socket to which this permission will apply will allow connections
 from www.contoso.com.
mySocketPermission1->AddPermission( NetworkAccess::Accept, TransportType::Tcp,
  "www.contoso.com", 11000 );

// Creates a SocketPermission which will allow the target Socket to
 connect with www.southridgevideo.com.
SocketPermission^ mySocketPermission2 = gcnew SocketPermission( NetworkAccess::Connect,TransportType::Tcp,
 "www.southridgevideo.com",11002 );

// Creates a SocketPermission from the union of two SocketPermissions.
SocketPermission^ mySocketPermissionUnion =
   (SocketPermission^)( mySocketPermission1->Union( mySocketPermission2 ) );

// Checks to see if the union was successfully created by using the
 IsSubsetOf method.
if ( mySocketPermission1->IsSubsetOf( mySocketPermissionUnion
 ) &&
   mySocketPermission2->IsSubsetOf( mySocketPermissionUnion ) )
{
   Console::WriteLine(  "This union contains permissions from both mySocketPermission1
 and mySocketPermission2" );
   
   // Prints the allowable accept URIs to the console.
   Console::WriteLine(  "This union accepts connections on :" );

   IEnumerator^ myEnumerator = mySocketPermissionUnion->AcceptList;
   while ( myEnumerator->MoveNext() )
   {
      Console::WriteLine( safe_cast<EndpointPermission^>( myEnumerator->Current
 )->ToString() );
   }
   
   // Prints the allowable connect URIs to the console.
   Console::WriteLine(  "This union permits connections to :" );

   myEnumerator = mySocketPermissionUnion->ConnectList;
   while ( myEnumerator->MoveNext() )
   {
      Console::WriteLine( safe_cast<EndpointPermission^>( myEnumerator->Current
 )->ToString() );
   }
}
// Creates a SocketPermission restricting access to and from all URIs.
SocketPermission mySocketPermission1 
    = new SocketPermission(PermissionState.None);
// The socket to which this permission will apply will allow 
// connections from www.contoso.com.
mySocketPermission1.AddPermission(NetworkAccess.Accept, 
    TransportType.Tcp, "www.contoso.com", 11000);
// Creates a SocketPermission which will allow the target Socket to
 
// connect with www.southridgevideo.com.
SocketPermission mySocketPermission2 
    = new SocketPermission(NetworkAccess.Connect, 
    TransportType.Tcp, "www.southridgevideo.com", 11002);
// Creates a SocketPermission from the union of two SocketPermissions.
SocketPermission mySocketPermissionUnion 
    = (SocketPermission)mySocketPermission1.Union(mySocketPermission2);
// Checks to see if the union was successfully created by using the
 
// IsSubsetOf method.
if (mySocketPermission1.IsSubsetOf(mySocketPermissionUnion) 
    && mySocketPermission2.IsSubsetOf(mySocketPermissionUnion)) {
    Console.WriteLine("This union contains permissions from both "    
                             + "mySocketPermission1 and mySocketPermission2");
    // Prints the allowable accept URIs to the console.
    Console.WriteLine("This union accepts connections on :");

    IEnumerator myEnumerator = mySocketPermissionUnion.
        get_AcceptList();
    while (myEnumerator.MoveNext()) {
        Console.WriteLine(((EndpointPermission)myEnumerator.
            get_Current()).ToString());
    }
    // Prints the allowable connect URIs to the console.
    Console.WriteLine("This union permits connections to :");

    myEnumerator = mySocketPermissionUnion.get_ConnectList();
    while (myEnumerator.MoveNext()) {
        Console.WriteLine(((EndpointPermission)myEnumerator.
            get_Current()).ToString());
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からSocketPermission.AcceptList プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSocketPermission.AcceptList プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSocketPermission.AcceptList プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

SocketPermission.AcceptList プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SocketPermission.AcceptList プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS