RandomAccess.GetLength(SafeFileHandle) 方法

定义

获取文件的长度(以字节为单位)。

public:
 static long GetLength(Microsoft::Win32::SafeHandles::SafeFileHandle ^ handle);
public static long GetLength(Microsoft.Win32.SafeHandles.SafeFileHandle handle);
static member GetLength : Microsoft.Win32.SafeHandles.SafeFileHandle -> int64
Public Shared Function GetLength (handle As SafeFileHandle) As Long

参数

handle
SafeFileHandle

文件句柄。

返回

一个长值,表示文件的长度(以字节为单位)。

例外

handlenull

handle 无效。

文件已关闭。

该文件不支持查找(管道或套接字)。

适用于