Gets the file handle for the file that the current FileStream object encapsulates.
[Visual Basic] Overridable Public Function GetHandle() As Integer [C#] public virtual int GetHandle(); [C++] public: virtual int GetHandle(); [JScript] public function GetHandle() : int;
The file handle for the file encapsulated by this FileStream object, or-1 if the file stream has been closed.
Exception Type | Condition |
---|---|
SecurityException | The caller does not have the required permission. |
NGWS Runtime Security:
SecurityPermission | UnmanagedCode flag must be set to call unmanaged code, such as calling native code with PInvoke or COM Interop. |