Delen via


FileTextLoader(String, Encoding) Constructor

Definition

Creates a content loader for specified file.

public:
 FileTextLoader(System::String ^ path, System::Text::Encoding ^ defaultEncoding);
public FileTextLoader (string path, System.Text.Encoding defaultEncoding);
public FileTextLoader (string path, System.Text.Encoding? defaultEncoding);
new Microsoft.CodeAnalysis.FileTextLoader : string * System.Text.Encoding -> Microsoft.CodeAnalysis.FileTextLoader
Public Sub New (path As String, defaultEncoding As Encoding)

Parameters

path
String

An absolute file path.

defaultEncoding
Encoding

Specifies an encoding to be used if the actual encoding can't be determined from the stream content (the stream doesn't start with Byte Order Mark). If not specified auto-detect heuristics are used to determine the encoding. Note that if the stream starts with Byte Order Mark the value of defaultEncoding is ignored.

Exceptions

path is null.

path is not an absolute path.

Applies to