NetCodeGroup.GetConnectAccessRules Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the connection access information for the current code group.
public:
cli::array <System::Collections::DictionaryEntry> ^ GetConnectAccessRules();
public System.Collections.DictionaryEntry[] GetConnectAccessRules ();
member this.GetConnectAccessRules : unit -> System.Collections.DictionaryEntry[]
Public Function GetConnectAccessRules () As DictionaryEntry()
Returns
A DictionaryEntry array containing connection access information.
Examples
The following code example demonstrates displaying the connection access rules for a NetCodeGroup object.
static void DisplayConnectionAccessRules(NetCodeGroup^ group)
{
array<System::Collections::DictionaryEntry>^ rules =
group->GetConnectAccessRules();
for each (System::Collections::DictionaryEntry^ o in rules)
{
String^ key = (String^)(o->Key);
array<CodeConnectAccess^>^ values = (array<CodeConnectAccess^>^)(o->Value);
Console::WriteLine("Origin scheme: {0}", key);
for each (CodeConnectAccess^ c in values)
{
Console::WriteLine("Scheme {0} Port: {1}", c->Scheme, c->Port);
}
Console::WriteLine("__________________________");
}
}
public static void DisplayConnectionAccessRules(NetCodeGroup group)
{
System.Collections.DictionaryEntry[] rules = group.GetConnectAccessRules();
foreach (System.Collections.DictionaryEntry o in rules)
{
string key = o.Key as string;
CodeConnectAccess[] values = (CodeConnectAccess[]) o.Value;
Console.WriteLine("Origin scheme: {0}", key);
foreach (CodeConnectAccess c in values)
{
Console.WriteLine("Scheme {0} Port: {1}", c.Scheme, c.Port);
}
Console.WriteLine("__________________________");
}
}
Remarks
In each dictionary entry, the Key property value is the origin scheme, and the Value property value is the array of associated CodeConnectAccess objects. If there are no associated CodeConnectAccess objects, DictionaryEntry.Value returns an empty array.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기