Прочетете на английски Редактиране

Споделяне чрез


RandomAccess.SetLength(SafeFileHandle, Int64) Method

Definition

Sets the length of the file to the given value.

C#
public static void SetLength(Microsoft.Win32.SafeHandles.SafeFileHandle handle, long length);

Parameters

handle
SafeFileHandle

The file handle.

length
Int64

The length of the file in bytes.

Exceptions

handle is null.

handle is invalid.

The file is closed.

The file does not support seeking (pipe or socket).

length is negative.

Applies to

Продукт Версии
.NET 7, 8, 9, 10