XslCompiledTransform.TemporaryFiles 屬性

定義

取得 TempFileCollection,包含成功呼叫 Load 方法後,在磁碟上產生的暫存檔案。

public:
 property System::CodeDom::Compiler::TempFileCollection ^ TemporaryFiles { System::CodeDom::Compiler::TempFileCollection ^ get(); };
public System.CodeDom.Compiler.TempFileCollection TemporaryFiles { get; }
member this.TemporaryFiles : System.CodeDom.Compiler.TempFileCollection
Public ReadOnly Property TemporaryFiles As TempFileCollection

屬性值

TempFileCollection,包含磁碟上產生的暫存檔案。 如果尚未成功呼叫 Load 方法,或尚未啟用偵錯,則這個值為 null

範例

下列範例會將暫存檔案的名稱寫入主控台。

注意

只有在載入具有 msxsl:script > 區塊的 < 樣式表單時,才會建立暫存檔案。

// Create the XslCompiledTransform object.
XslCompiledTransform xslt = new XslCompiledTransform(true);

// Load the style sheet and enable scripts.
// Temporary files are created only for style sheets with <msxsl:script> blocks.
xslt.Load("output.xsl", XsltSettings.TrustedXslt, new XmlUrlResolver());

// Transform the file.
xslt.Transform("books.xml", "output.xml");

// Output names of temporary files.
foreach (string filename in xslt.TemporaryFiles)
    Console.WriteLine(filename);
' Create the XslCompiledTransform object.
Dim xslt As New XslCompiledTransform(True)

' Load the style sheet and enable scripts.
' Temporary files are created only for style sheets with <msxsl:script> blocks.
xslt.Load("output.xsl", XsltSettings.TrustedXslt, New XmlUrlResolver())

' Transform the file.
xslt.Transform("books.xml", "output.xml")

' Output names of temporary files.
Dim filename As String
For Each filename In xslt.TemporaryFiles
    Console.WriteLine(filename)
Next filename

備註

此屬性會識別 XSLT 處理期間產生的檔案。 檔案會放在您的 Temp 目錄中, (%TEMP% 環境變數所指定,) 您可以在 XSLT 處理完成之後刪除這些檔案。

適用於

另請參閱