共用方式為


SoapServices.DecodeXmlNamespaceForClrTypeNamespace 方法

定義

從提供的 Common Language Runtime 命名空間,解碼 XML 命名空間和組件名稱。

public:
 static bool DecodeXmlNamespaceForClrTypeNamespace(System::String ^ inNamespace, [Runtime::InteropServices::Out] System::String ^ % typeNamespace, [Runtime::InteropServices::Out] System::String ^ % assemblyName);
public static bool DecodeXmlNamespaceForClrTypeNamespace (string inNamespace, out string typeNamespace, out string assemblyName);
[System.Security.SecurityCritical]
public static bool DecodeXmlNamespaceForClrTypeNamespace (string inNamespace, out string typeNamespace, out string assemblyName);
static member DecodeXmlNamespaceForClrTypeNamespace : string * string * string -> bool
[<System.Security.SecurityCritical>]
static member DecodeXmlNamespaceForClrTypeNamespace : string * string * string -> bool
Public Shared Function DecodeXmlNamespaceForClrTypeNamespace (inNamespace As String, ByRef typeNamespace As String, ByRef assemblyName As String) As Boolean

參數

inNamespace
String

Common Language Runtime 命名空間。

typeNamespace
String

當這個方法傳回時,含有存有已解碼命名空間名稱的 String。 這個參數會以未初始化的狀態傳遞。

assemblyName
String

當這個方法傳回時,含有存有已解碼組件名稱的 String。 這個參數會以未初始化的狀態傳遞。

傳回

如果命名空間和組件名稱解碼成功,則為 true,否則為 false

屬性

例外狀況

inNamespace 參數是 null 或空白。

立即呼叫端沒有基礎結構使用權限。

範例

下列程式碼範例會顯示如何使用這個方法。 此程式代碼範例是提供給 類別之較大範例的 SoapServices 一部分。

// Extract a CLR namespace and assembly name from an XML namespace.
String^ typeNamespace;
String^ assemblyName;
SoapServices::DecodeXmlNamespaceForClrTypeNamespace(
   xmlNamespace,typeNamespace,assemblyName );
Console::WriteLine( L"The name of the CLR namespace is {0}.", typeNamespace );
Console::WriteLine( L"The name of the CLR assembly is {0}.", assemblyName );
// Extract a CLR namespace and assembly name from an XML namespace.
string typeNamespace;
string assemblyName;
SoapServices.DecodeXmlNamespaceForClrTypeNamespace(xmlNamespace,
    out typeNamespace, out assemblyName);
Console.WriteLine("The name of the CLR namespace is {0}.", 
    typeNamespace);
Console.WriteLine("The name of the CLR assembly is {0}.", 
    assemblyName);

備註

當 .NET Framework 剖析 XML 數據流時,它必須知道如何將從數據流讀取的 XML 轉換成 Common Language Runtime 類型。 指定 .NET Framework 產生和剖析 XML 資料流如何儲存在命名空間中的System.Runtime.Remoting.Metadata自訂屬性中的資訊。 在組態檔中指定這項資訊的方法有兩種:藉由明確指定對應,或指定要預先載入的物件類型。 目前的方法支援擷取這類對應。

適用於