TempFileCollection 建構函式

定義

初始化 TempFileCollection 類別的新執行個體。

多載

TempFileCollection()

使用預設值,初始化 TempFileCollection 類別的新執行個體。

TempFileCollection(String)

使用預設設定在暫存檔產生並使用過後加以刪除的指定暫存目錄,初始化 TempFileCollection 類別的新執行個體。

TempFileCollection(String, Boolean)

使用指定的暫存目錄,以及指示是否要在暫存檔產生並使用過後加以保留或刪除的指定值,初始化 TempFileCollection 類別的新執行個體。

TempFileCollection()

來源:
TempFileCollection.cs
來源:
TempFileCollection.cs
來源:
TempFileCollection.cs

使用預設值,初始化 TempFileCollection 類別的新執行個體。

public:
 TempFileCollection();
public TempFileCollection ();
Public Sub New ()

備註

這是使用預設設定初始化集合的無參數建構函式。 根據預設,此暫存盤集合會將檔案儲存在預設暫存目錄中,並在產生及使用暫存盤之後刪除暫存盤。

適用於

TempFileCollection(String)

來源:
TempFileCollection.cs
來源:
TempFileCollection.cs
來源:
TempFileCollection.cs

使用預設設定在暫存檔產生並使用過後加以刪除的指定暫存目錄,初始化 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.cs
來源:
TempFileCollection.cs
來源:
TempFileCollection.cs

使用指定的暫存目錄,以及指示是否要在暫存檔產生並使用過後加以保留或刪除的指定值,初始化 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呼叫 方法時,如果 KeepFilestrue,則會刪除所有檔案,包括以 KeepFilestrue新增的檔案。 這可讓識別為保留檔案的特定檔案在編譯之後暫時保留,例如錯誤報告,然後在不再需要時刪除。

適用於