Redigera

Dela via


TempFileCollection.AddExtension Method

Definition

Adds a file name with the specified file name extension to the collection.

Overloads

AddExtension(String)

Adds a file name with the specified file name extension to the collection.

AddExtension(String, Boolean)

Adds a file name with the specified file name extension to the collection, using the specified value indicating whether the file should be deleted or retained.

AddExtension(String)

Source:
TempFileCollection.cs
Source:
TempFileCollection.cs
Source:
TempFileCollection.cs
Source:
TempFileCollection.cs

Adds a file name with the specified file name extension to the collection.

public:
 System::String ^ AddExtension(System::String ^ fileExtension);
public string AddExtension (string fileExtension);
member this.AddExtension : string -> string
Public Function AddExtension (fileExtension As String) As String

Parameters

fileExtension
String

The file name extension for the auto-generated temporary file name to add to the collection.

Returns

A file name with the specified extension that was just added to the collection.

Remarks

This method returns a file name with the specified extension that has been added to the temporary files collection. Other code must still create the file before it can be used.

This method can be called only once for each file name extension, because it will return the same name if it is called with the same extension.

Applies to

AddExtension(String, Boolean)

Source:
TempFileCollection.cs
Source:
TempFileCollection.cs
Source:
TempFileCollection.cs
Source:
TempFileCollection.cs

Adds a file name with the specified file name extension to the collection, using the specified value indicating whether the file should be deleted or retained.

public:
 System::String ^ AddExtension(System::String ^ fileExtension, bool keepFile);
public string AddExtension (string fileExtension, bool keepFile);
member this.AddExtension : string * bool -> string
Public Function AddExtension (fileExtension As String, keepFile As Boolean) As String

Parameters

fileExtension
String

The file name extension for the auto-generated temporary file name to add to the collection.

keepFile
Boolean

true if the file should be kept after use; false if the file should be deleted.

Returns

A file name with the specified extension that was just added to the collection.

Exceptions

fileExtension is null or an empty string.

Remarks

This method returns a file name with the specified extension that has been added to the temporary files collection. Other code must still create the file before it can be used.

This method can be called only once for each file name extension, because it will return the same name if it is called with the same extension.

Applies to