語言

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

檔句柄。

傳回

一個長值代表檔案長度(以位元組為單位)。

例外狀況

handle 是 null。

handle 無效。

檔案已結案。

該檔案不支援尋址(管道或套接字)。

適用於