System.Windows.Forms.OpenFileDialog.OpenFile Method

Opens the file selected by the user, with read-only permission. The file is specified by the FileDialog.FileName property.

Syntax

public System.IO.Stream OpenFile ()

Returns

A System.IO.Stream that specifies the read-only file selected by the user.

Remarks

The OpenFileDialog.OpenFile method is used to provide a facility to quickly open a file from the dialog box. The file is opened in read-only mode for security purposes. To open a file in read/write mode, you must use another method, such as System.IO.FileStream.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0