TempFileCollection 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 TempFileCollection 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| TempFileCollection() |
初始化一個以預設值的新類別實例 TempFileCollection 。 |
| TempFileCollection(String) |
使用指定的暫存目錄初始化該類別的新實例 TempFileCollection ,該目錄預設在產生與使用後刪除暫存檔案。 |
| TempFileCollection(String, Boolean) |
使用指定的暫存目錄初始化類別的新實例 TempFileCollection ,並預設值指示在產生與使用後是否保留或刪除暫存檔案。 |
TempFileCollection()
初始化一個以預設值的新類別實例 TempFileCollection 。
public:
TempFileCollection();
public TempFileCollection();
Public Sub New ()
備註
這是一個無參數建構器,會以預設設定初始化集合。 預設情況下,這個暫存檔案集合會將檔案儲存在預設的暫存目錄中,並在暫存檔案產生並使用後刪除。
適用於
TempFileCollection(String)
使用指定的暫存目錄初始化該類別的新實例 TempFileCollection ,該目錄預設在產生與使用後刪除暫存檔案。
public:
TempFileCollection(System::String ^ tempDir);
public TempFileCollection(string tempDir);
new System.CodeDom.Compiler.TempFileCollection : string -> System.CodeDom.Compiler.TempFileCollection
Public Sub New (tempDir As String)
參數
- tempDir
- String
一個用來儲存暫存檔案的暫存目錄路徑。
適用於
TempFileCollection(String, Boolean)
使用指定的暫存目錄初始化類別的新實例 TempFileCollection ,並預設值指示在產生與使用後是否保留或刪除暫存檔案。
public:
TempFileCollection(System::String ^ tempDir, bool keepFiles);
public TempFileCollection(string tempDir, bool keepFiles);
new System.CodeDom.Compiler.TempFileCollection : string * bool -> System.CodeDom.Compiler.TempFileCollection
Public Sub New (tempDir As String, keepFiles As Boolean)
參數
- tempDir
- String
一個用來儲存暫存檔案的暫存目錄路徑。
- keepFiles
- Boolean
true 如果使用後暫時檔案應保留; false 如果暫時檔案應該被刪除。
備註
參數的值 keepFiles 用來設定參數 KeepFiles 。 集合中的暫存檔案會在編譯器活動完成後,根據集合中屬性的價值 KeepFiles 被保留或刪除。 當每個檔案加入集合時,會與該檔案關聯當前的值 KeepFiles ,除非是透過帶有 keepFile 參數的方法加入,此時該值會用於該特定檔案。 當 Delete 方法被呼叫時,若 KeepFiles 為 , true則所有檔案皆被刪除,包括以 KeepFilestrue為 的新增檔案。 這允許特定檔案,即被識別為保留檔案的檔案,在編譯後暫時保留用於錯誤報告等用途,當不再需要時再刪除。