ChannelServices.GetChannelSinkProperties(Object) 方法

定义

返回给定代理的属性的 IDictionary

public:
 static System::Collections::IDictionary ^ GetChannelSinkProperties(System::Object ^ obj);
public static System.Collections.IDictionary GetChannelSinkProperties (object obj);
static member GetChannelSinkProperties : obj -> System.Collections.IDictionary
Public Shared Function GetChannelSinkProperties (obj As Object) As IDictionary

参数

obj
Object

为其检索属性的代理。

返回

IDictionary

到属性字典的接口,或者如果未找到任何属性,则为 null

例外

在调用堆栈上部,至少有一个调用方没有配置远程处理类型和通道的权限。

示例

// Get an IDictionary of properties for a given proxy.
IDictionary^ myDictionary = ChannelServices::GetChannelSinkProperties( myProxy );
ICollection^ myKeysCollection = myDictionary->Keys;
array<Object^>^myKeysArray = gcnew array<Object^>(myKeysCollection->Count);
ICollection^ myValuesCollection = myDictionary->Values;
array<Object^>^myValuesArray = gcnew array<Object^>(myValuesCollection->Count);
myKeysCollection->CopyTo( myKeysArray, 0 );
myValuesCollection->CopyTo( myValuesArray, 0 );
for ( int iIndex = 0; iIndex < myKeysArray->Length; iIndex++ )
{
   Console::WriteLine( "Property Name : {0} value : {1}", myKeysArray[ iIndex ], myValuesArray[ iIndex ] );

}
// Get an IDictionary of properties for a given proxy.
IDictionary myDictionary = ChannelServices.
         GetChannelSinkProperties(myProxy);
ICollection myKeysCollection = myDictionary.Keys;
object[] myKeysArray = new object[myKeysCollection.Count];
ICollection myValuesCollection = myDictionary.Values;
object[] myValuesArray = new object[myValuesCollection.Count];
myKeysCollection.CopyTo(myKeysArray,0);
myValuesCollection.CopyTo(myValuesArray,0);
for(int iIndex=0;iIndex<myKeysArray.Length;iIndex++)
{
   Console.WriteLine("Property Name : "+myKeysArray[iIndex]+
      " value : "+myValuesArray[iIndex]);
}
' Get an IDictionary of properties for a given proxy.
Dim myDictionary As IDictionary = ChannelServices.GetChannelSinkProperties(myProxy)
Dim myKeysCollection As ICollection = myDictionary.Keys
Dim myKeysArray(myKeysCollection.Count-1) As Object
Dim myValuesCollection As ICollection = myDictionary.Values
Dim myValuesArray(myValuesCollection.Count-1) As Object
myKeysCollection.CopyTo(myKeysArray, 0)
myValuesCollection.CopyTo(myValuesArray, 0)
Dim iIndex As Integer
For iIndex = 0 To myKeysArray.Length - 1
   Console.Write("Property Name : " & myKeysArray(iIndex) & " value : ")
   Console.WriteLine(myValuesArray(iIndex))
Next iIndex

适用于