PersonalStorage.CreateAsync

CreateAsync(string, FileFormatVersion, CancellationToken)

Creates the new PST file with the specified file name.

public static Task<PersonalStorage> CreateAsync(string fileName, FileFormatVersion version, 
    CancellationToken token = default)
ParameterTypeDescription
fileNameStringThe full name of the file.
versionFileFormatVersionThe PST file version.
tokenCancellationTokenPropagates notification that operations should be canceled.

Return Value

A PersonalStorage object that represents the new PST.

Exceptions

exceptioncondition
NotImplementedExceptionthrows if ANSI file version is created
ArgumentNullExceptionthrows if file name is null or empty

Remarks

Note, only Unicode file version creation is supported now.

See Also


CreateAsync(Stream, FileFormatVersion, CancellationToken)

Creates the PST in a stream.

public static Task<PersonalStorage> CreateAsync(Stream stream, FileFormatVersion version, 
    CancellationToken token = default)
ParameterTypeDescription
streamStreamThe stream in which PST is created.
versionFileFormatVersionThe PST file version.
tokenCancellationTokenPropagates notification that operations should be canceled.

Return Value

A PersonalStorage object that represents the new PST.

Exceptions

exceptioncondition
NotImplementedExceptionthrows if ANSI file version is created
ArgumentNullExceptionthrows if file name is null or empty

Remarks

Note, only Unicode file version creation is supported now.

See Also


CreateAsync(Stream, FileFormatVersion, bool, CancellationToken)

Creates the PST in a stream.

public static Task<PersonalStorage> CreateAsync(Stream stream, FileFormatVersion version, 
    bool leaveStreamOpen, CancellationToken token = default)
ParameterTypeDescription
streamStreamThe stream in which PST is created.
versionFileFormatVersionThe PST file version.
leaveStreamOpenBooleanLeave stream open when PersonalStorage is disposed.
tokenCancellationTokenPropagates notification that operations should be canceled.

Return Value

A PersonalStorage object that represents the new PST.

Exceptions

exceptioncondition
NotImplementedExceptionthrows if ANSI file version is created
ArgumentNullExceptionthrows if file name is null or empty

Remarks

Note, only Unicode file version creation is supported now.

See Also