TempFileCollection.KeepFiles 屬性
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
呼叫 Delete() 方法或處置集合時,根據預設值取得或設定值,指出是否保留檔案。
public:
property bool KeepFiles { bool get(); void set(bool value); };
C#
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 檔案。 這會導致刪除所有檔案。
產品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |