TempFileCollection.KeepFiles 屬性

定義

呼叫 Delete() 方法或處置集合時,根據預設值取得或設定值,指出是否保留檔案。

public:
 property bool KeepFiles { bool get(); void set(bool value); };
public bool KeepFiles { get; set; }
member this.KeepFiles : bool with get, set
Public Property KeepFiles As Boolean

屬性值

如果應該保留檔案,則為 true,否則為 false

備註

呼叫AddExtension沒有keepFile參數的多KeepFiles載時,屬性的值會當做預設值使用,以將臨時檔新增至集合。 集合中的每個臨時檔都有相關聯的保留檔案旗標,以根據每個檔案決定要保留或刪除該檔案。 根據檔案的關聯保留檔案值,檔案會在編譯完成時自動保留或刪除。 不過,編譯完成後,可以藉由設定 KeepFiles false 並呼叫 方法來釋放保留的 Delete 檔案。 這會導致刪除所有檔案。

適用於