共用方式為


XProcessingInstruction.Target 屬性

定義

取得或設定此處理指令的目標應用程式。

public:
 property System::String ^ Target { System::String ^ get(); void set(System::String ^ value); };
public string Target { get; set; }
member this.Target : string with get, set
Public Property Target As String

屬性值

此處理指令的目標應用。

例外狀況

字串 valuenull

目標不遵循 XML 名稱的限制。

範例

以下範例使用該 Target 屬性來取得處理指令的目標應用程式。

XProcessingInstruction pi =
    new XProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"hello.xsl\"");
Console.WriteLine(pi.Target);
Dim pi As XProcessingInstruction = _
    <?xml-stylesheet type="text/xsl" href="hello.xsl"?>
Console.WriteLine(pi.Target)

此範例會產生下列輸出:

xml-stylesheet

適用於

另請參閱