System.IO.File.OpenRead C# (CSharp) Méthode

OpenRead() public static méthode

public static OpenRead ( string path ) : System.IO.FileStream
path string
Résultat System.IO.FileStream
        public static System.IO.FileStream OpenRead(string path) { throw null; }
        public static System.IO.StreamReader OpenText(string path) { throw null; }

Same methods

File::OpenRead ( String path ) : FileStream

Usage Example

    /// <summary>
    ///     Opens a <see cref="Stream" /> to read from a file.
    /// </summary>
    /// <param name="path">The path of the file.</param>
    /// <returns>
    ///     A <see cref="Stream" /> that can read from a file.
    /// </returns>
    /// <exception cref="ArgumentNullException">
    ///     <paramref name="path" /> is <see langword="null" /> (<see langword="Nothing" /> in Visual Basic).
    /// </exception>
    public Stream OpenRead(string path)
    {
        _ = Requires.NotNullOrWhiteSpace(
            path,
            nameof(path));

        return(FSFile.OpenRead(path));
    }
All Usage Examples Of System.IO.File::OpenRead