TempFileCollection 构造函数

定义

初始化 TempFileCollection 类的新实例。

重载

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 参数的方法添加该值,在这种情况下,该值用于该特定文件。 When the Delete method is called, if KeepFiles is true, all files are deleted, including those added with a KeepFiles value of true. 这允许在编译后暂时保留被标识为保留文件的特定文件(如错误报告),然后在不再需要这些文件时将其删除。

适用于