PolicyLevel.ResolveMatchingCodeGroups メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As PolicyLevel Dim evidence As Evidence Dim returnValue As CodeGroup returnValue = instance.ResolveMatchingCodeGroups(evidence)
戻り値
指定した証拠と一致するコード グループのツリーのルートを表す CodeGroup。


このメソッドを使用すると、特定の証拠のセットに対する、ポリシー レベル内のコード グループの効果を分析できます。たとえば、セキュリティ ポリシーが、コードが必要とする必要最小限のアクセス許可をアセンブリに与えていない場合は、問題がどこにあるのかをコード グループの検査によって正確に確認することが難しくなります。
このメソッドは、子コード グループを持つことができるコード グループを返すため、管理者はコード グループとその子コード グループを検査し、どのコード グループが一致するかを判断できます。

コード グループの一致を解決する方法を次のコード例に示します。このコード例は、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

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からPolicyLevel.ResolveMatchingCodeGroups メソッドを検索する場合は、下記のリンクをクリックしてください。

- PolicyLevel.ResolveMatchingCodeGroups メソッドのページへのリンク