ChannelServices.GetUrlsForObject(MarshalByRefObject) 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.
Returns an array of all the URLs that can be used to reach the specified object.
public:
static cli::array <System::String ^> ^ GetUrlsForObject(MarshalByRefObject ^ obj);
public static string[] GetUrlsForObject (MarshalByRefObject obj);
[System.Security.SecurityCritical]
public static string[] GetUrlsForObject (MarshalByRefObject obj);
static member GetUrlsForObject : MarshalByRefObject -> string[]
[<System.Security.SecurityCritical>]
static member GetUrlsForObject : MarshalByRefObject -> string[]
Public Shared Function GetUrlsForObject (obj As MarshalByRefObject) As String()
Parameters
The object to retrieve the URL array for.
Returns
String[]
An array of strings that contains the URLs that can be used to remotely identify the object, or null
if none were found.
- Attributes
Exceptions
The immediate caller does not have infrastructure permission.
Examples
array<String^>^myURLArray = ChannelServices::GetUrlsForObject( myHelloServer );
Console::WriteLine( "Number of URLs for the specified Object: {0}", myURLArray->Length );
for ( int iIndex = 0; iIndex < myURLArray->Length; iIndex++ )
Console::WriteLine( "URL: {0}", myURLArray[ iIndex ] );
string[] myURLArray = ChannelServices.GetUrlsForObject(myHelloServer);
Console.WriteLine("Number of URLs for the specified Object: "
+myURLArray.Length);
for (int iIndex=0; iIndex<myURLArray.Length; iIndex++)
Console.WriteLine("URL: "+myURLArray[iIndex]);
Dim myURLArray As String() = ChannelServices.GetUrlsForObject(myHelloServer)
Console.WriteLine("Number of URLs for the specified Object: " + _
myURLArray.Length.ToString())
Dim iIndex As Integer
For iIndex = 0 To myURLArray.Length - 1
Console.WriteLine("URL: " + myURLArray(iIndex))
Next iIndex
Applies to
Colaborați cu noi pe GitHub
Sursa pentru acest conținut poate fi găsită pe GitHub, unde puteți, de asemenea, să creați și să consultați probleme și solicitări de tragere. Pentru mai multe informații, consultați ghidul nostru pentru colaboratori.