Click or drag to resize

ExtensionsDirectoryInfoCreateFileAsync Method (DirectoryInfo, String)

Creates a new file with the specified name in the current folder.

Namespace:  Cauldron
Assembly:  Cauldron (in Cauldron.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public static Task<FileInfo> CreateFileAsync(
	this DirectoryInfo directoryInfo,
	string desiredName
)

Parameters

directoryInfo
Type: System.IODirectoryInfo
The DirectoryInfo representing the current folder
desiredName
Type: SystemString
The name of the new file to create in the current folder.

Return Value

Type: TaskFileInfo
When this method completes, it returns a FileInfo that represents the new file.>

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DirectoryInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptiondesiredName is null
ArgumentExceptiondesiredName is empty
See Also