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

OpenText() public static méthode

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

Same methods

File::OpenText ( String path ) : StreamReader

Usage Example

    /// <summary>
    ///     Opens a <see cref="StreamReader" /> to read text from a file.
    /// </summary>
    /// <param name="path">The path of the file.</param>
    /// <returns>
    ///     A <see cref="StreamReader" /> 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 StreamReader OpenText(string path)
    {
        _ = Requires.NotNullOrWhiteSpace(
            path,
            nameof(path));

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