Bagikan melalui


NetCodeGroup.GetConnectAccessRules Metode

Definisi

Mendapatkan informasi akses koneksi untuk grup kode saat ini.

public:
 cli::array <System::Collections::DictionaryEntry> ^ GetConnectAccessRules();
public System.Collections.DictionaryEntry[] GetConnectAccessRules ();
member this.GetConnectAccessRules : unit -> System.Collections.DictionaryEntry[]
Public Function GetConnectAccessRules () As DictionaryEntry()

Mengembalikan

Array DictionaryEntry yang berisi informasi akses koneksi.

Contoh

Contoh kode berikut menunjukkan menampilkan aturan akses koneksi untuk objek NetCodeGroup .


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("__________________________");
    }
}

Keterangan

Dalam setiap entri kamus, Key nilai properti adalah skema asal, dan Value nilai properti adalah array objek terkait CodeConnectAccess . Jika tidak ada objek terkait CodeConnectAccess , DictionaryEntry.Value mengembalikan array kosong.

Berlaku untuk