PolicyLevel.ResolveMatchingCodeGroups メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > PolicyLevel.ResolveMatchingCodeGroups メソッドの意味・解説 

PolicyLevel.ResolveMatchingCodeGroups メソッド

ポリシー レベルポリシー解決し証拠一致するコード グループ ツリールート返します

名前空間: System.Security.Policy
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Function ResolveMatchingCodeGroups (
 _
    evidence As Evidence _
) As CodeGroup
Dim instance As PolicyLevel
Dim evidence As Evidence
Dim returnValue As CodeGroup

returnValue = instance.ResolveMatchingCodeGroups(evidence)
public CodeGroup ResolveMatchingCodeGroups (
    Evidence evidence
)
public:
CodeGroup^ ResolveMatchingCodeGroups (
    Evidence^ evidence
)
public CodeGroup ResolveMatchingCodeGroups (
    Evidence evidence
)
public function ResolveMatchingCodeGroups (
    evidence : Evidence
) : CodeGroup

パラメータ

evidence

ポリシー解決するために使用する Evidence

戻り値
指定した証拠一致するコード グループツリールートを表す CodeGroup。

例外例外
例外種類条件

PolicyException

ポリシー レベルには、排他としてマークされた、複数一致するコード グループ含まれます。

ArgumentNullException

evidence パラメータnull 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

コード グループ一致解決する方法次のコード例示します。このコード例は、PolicyLevel クラストピック取り上げているコード例一部分です。

' Demonstrate the use of ResolvePolicy for the supplied evidence and
 a specified policy level.
Private Overloads Shared
 Sub CheckEvidence(ByVal pLevel As
 PolicyLevel, ByVal evidence As Evidence)
    ' Display the code groups to which the evidence belongs.
    Console.WriteLine(ControlChars.Tab + "ResolvePolicy for the
 given evidence: ")
    Dim codeGroup As IEnumerator = evidence.GetEnumerator()
    While codeGroup.MoveNext()
        Console.WriteLine((ControlChars.Tab + ControlChars.Tab + CType(codeGroup.Current,
 CodeGroup).Name))
    End While
    Console.WriteLine("The current evidence belongs to the following
 root CodeGroup:")
    ' pLevel is the current PolicyLevel, evidence is the Evidence to
 be resolved.
    Dim cg1 As CodeGroup = pLevel.ResolveMatchingCodeGroups(evidence)
    Console.WriteLine((pLevel.Label + " Level"))
    Console.WriteLine((ControlChars.Tab + "Root CodeGroup = "
 + cg1.Name))

    ' Show how Resolve is used to determine the set of permissions that
 
    ' the security system grants to code, based on the evidence.
    ' Show the granted permissions. 
    Console.WriteLine(ControlChars.Lf + "Current permissions granted:")
    Dim pState As PolicyStatement = pLevel.Resolve(evidence)
    Console.WriteLine(pState.ToXml().ToString())

    Return
End Sub 'CheckEvidence

// Demonstrate the use of ResolvePolicy for the supplied evidence and
 a specified policy level.
private static void CheckEvidence(PolicyLevel
 pLevel, Evidence evidence)
{
    // Display the code groups to which the evidence belongs.
    Console.WriteLine("\tResolvePolicy for the given evidence:
 ");
    IEnumerator codeGroup = evidence.GetEnumerator();
    while (codeGroup.MoveNext())
    {
        Console.WriteLine("\t\t" + ((CodeGroup)codeGroup.Current).Name);
    }
    Console.WriteLine("The current evidence belongs to the following root CodeGroup:");
    // pLevel is the current PolicyLevel, evidence is the Evidence to
 be resolved.
    CodeGroup cg1 = pLevel.ResolveMatchingCodeGroups(evidence);
    Console.WriteLine(pLevel.Label + " Level");
    Console.WriteLine("\tRoot CodeGroup = " + cg1.Name);

    // Show how Resolve is used to determine the set of permissions
 that 
    // the security system grants to code, based on the evidence.

    // Show the granted permissions. 
    Console.WriteLine("\nCurrent permissions granted:");
    PolicyStatement pState = pLevel.Resolve(evidence);
    Console.WriteLine(pState.ToXml().ToString());

    return;
}
// Demonstrate the use of ResolvePolicy for the supplied evidence and
 a specified policy level.
void CheckEvidence( PolicyLevel^ pLevel, Evidence^ evidence )
{
   // Display the code groups to which the evidence belongs.
   Console::WriteLine( "\tResolvePolicy for the given evidence:
 " );
   IEnumerator^ codeGroup = evidence->GetEnumerator();
   while ( codeGroup->MoveNext() )
   {
      Console::WriteLine( "\t\t{0}", (dynamic_cast<CodeGroup^>(codeGroup->Current))->Name
 );
   }

   Console::WriteLine( "The current evidence belongs to the following root CodeGroup:"
 );

   // pLevel is the current PolicyLevel, evidence is the Evidence to
 be resolved.
   CodeGroup^ cg1 = pLevel->ResolveMatchingCodeGroups( evidence );
   Console::WriteLine( "{0} Level", pLevel->Label );
   Console::WriteLine( "\tRoot CodeGroup = {0}", cg1->Name );

   // Show how Resolve is used to determine the set of permissions that
 
   // the security system grants to code, based on the evidence.
   // Show the granted permissions. 
   Console::WriteLine( "\nCurrent permissions granted:" );
   PolicyStatement^ pState = pLevel->Resolve( evidence );
   Console::WriteLine( pState->ToXml() );
   return;
}
// Demonstrate the use of ResolvePolicy for the supplied evidence and
 
//a specified policy level.
private static void CheckEvidence(PolicyLevel
 pLevel, Evidence evidence)
{
    // Display the code groups to which the evidence belongs.
    Console.WriteLine("\tResolvePolicy for the given evidence:
 ");
    IEnumerator codeGroup = evidence.GetEnumerator();
    while (codeGroup.MoveNext()) {
        Console.WriteLine(("\t\t" + ((CodeGroup)
            (codeGroup.get_Current())).get_Name()));
    }

    Console.WriteLine("The current evidence belongs to the "
        + "following root CodeGroup:");

    // pLevel is the current PolicyLevel, evidence is the Evidence
    // to be resolved.
    CodeGroup cg1 = pLevel.ResolveMatchingCodeGroups(evidence);

    Console.WriteLine((pLevel.get_Label() + " Level"));
    Console.WriteLine(("\tRoot CodeGroup = " + cg1.get_Name()));

    // Show how Resolve is used to determine the set of permissions
 that 
    // the security system grants to code, based on the evidence.
    // Show the granted permissions. 
    Console.WriteLine("\nCurrent permissions granted:");
    PolicyStatement pState = pLevel.Resolve(evidence);
    Console.WriteLine(pState.ToXml().ToString());
    return;
} //CheckEvidence
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PolicyLevel クラス
PolicyLevel メンバ
System.Security.Policy 名前空間



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

辞書ショートカット

すべての辞書の索引

PolicyLevel.ResolveMatchingCodeGroups メソッドのお隣キーワード
検索ランキング

   

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



PolicyLevel.ResolveMatchingCodeGroups メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS