TextFieldParser Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the TextFieldParser class.
Overloads
| TextFieldParser(Stream) |
Initializes a new instance of the |
| TextFieldParser(TextReader) |
Initializes a new instance of the |
| TextFieldParser(String) |
Initializes a new instance of the |
| TextFieldParser(Stream, Encoding) |
Initializes a new instance of the |
| TextFieldParser(String, Encoding) |
Initializes a new instance of the |
| TextFieldParser(Stream, Encoding, Boolean) |
Initializes a new instance of the |
| TextFieldParser(String, Encoding, Boolean) |
Initializes a new instance of the |
| TextFieldParser(Stream, Encoding, Boolean, Boolean) |
Initializes a new instance of the |
TextFieldParser(Stream)
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
Initializes a new instance of the TextFieldParser class.
public:
TextFieldParser(System::IO::Stream ^ stream);
public TextFieldParser(System.IO.Stream stream);
new Microsoft.VisualBasic.FileIO.TextFieldParser : System.IO.Stream -> Microsoft.VisualBasic.FileIO.TextFieldParser
Public Sub New (stream As Stream)
Parameters
Exceptions
stream is Nothing.
stream cannot be read from.
Remarks
Creates a new TextFieldParser object to parse the file or stream that is represented by the stream parameter.
See also
- OpenTextFieldParser(String)
- Objects (Visual Basic)
- How to: Read From Comma-Delimited Text Files in Visual Basic
- How to: Read From Fixed-width Text Files in Visual Basic
- How to: Read From Text Files with Multiple Formats in Visual Basic
Applies to
TextFieldParser(TextReader)
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
Initializes a new instance of the TextFieldParser class.
public:
TextFieldParser(System::IO::TextReader ^ reader);
public TextFieldParser(System.IO.TextReader reader);
new Microsoft.VisualBasic.FileIO.TextFieldParser : System.IO.TextReader -> Microsoft.VisualBasic.FileIO.TextFieldParser
Public Sub New (reader As TextReader)
Parameters
- reader
- TextReader
TextReader. The TextReader stream to be parsed.
Exceptions
reader is Nothing.
Remarks
Creates a new TextFieldParser object to parse the file or stream that is represented by the reader parameter.
See also
- OpenTextFieldParser(String)
- Objects (Visual Basic)
- How to: Read From Comma-Delimited Text Files in Visual Basic
- How to: Read From Fixed-width Text Files in Visual Basic
- How to: Read From Text Files with Multiple Formats in Visual Basic
Applies to
TextFieldParser(String)
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
Initializes a new instance of the TextFieldParser class.
public:
TextFieldParser(System::String ^ path);
public TextFieldParser(string path);
new Microsoft.VisualBasic.FileIO.TextFieldParser : string -> Microsoft.VisualBasic.FileIO.TextFieldParser
Public Sub New (path As String)
Parameters
- path
- String
String. The complete path of the file to be parsed.
Exceptions
path is an empty string.
Remarks
Creates a new TextFieldParser object to parse the file specified by the path parameter.
See also
- OpenTextFieldParser(String)
- Objects (Visual Basic)
- How to: Read From Comma-Delimited Text Files in Visual Basic
- How to: Read From Fixed-width Text Files in Visual Basic
- How to: Read From Text Files with Multiple Formats in Visual Basic
Applies to
TextFieldParser(Stream, Encoding)
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
Initializes a new instance of the TextFieldParser class.
public:
TextFieldParser(System::IO::Stream ^ stream, System::Text::Encoding ^ defaultEncoding);
public TextFieldParser(System.IO.Stream stream, System.Text.Encoding defaultEncoding);
new Microsoft.VisualBasic.FileIO.TextFieldParser : System.IO.Stream * System.Text.Encoding -> Microsoft.VisualBasic.FileIO.TextFieldParser
Public Sub New (stream As Stream, defaultEncoding As Encoding)
Parameters
- defaultEncoding
- Encoding
Encoding. The character encoding to use if encoding is not determined from file. Default is UTF8.
Exceptions
stream or defaultEncoding is Nothing.
stream cannot be read from.
Remarks
Creates a new TextFieldParser object to parse the file or stream that is represented by the stream parameter.
Caution
When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable and could cause an exception to be thrown.
See also
- OpenTextFieldParser(String)
- Objects (Visual Basic)
- How to: Read From Comma-Delimited Text Files in Visual Basic
- How to: Read From Fixed-width Text Files in Visual Basic
- How to: Read From Text Files with Multiple Formats in Visual Basic
Applies to
TextFieldParser(String, Encoding)
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
Initializes a new instance of the TextFieldParser class.
public:
TextFieldParser(System::String ^ path, System::Text::Encoding ^ defaultEncoding);
public TextFieldParser(string path, System.Text.Encoding defaultEncoding);
new Microsoft.VisualBasic.FileIO.TextFieldParser : string * System.Text.Encoding -> Microsoft.VisualBasic.FileIO.TextFieldParser
Public Sub New (path As String, defaultEncoding As Encoding)
Parameters
- path
- String
String. The complete path of the file to be parsed.
- defaultEncoding
- Encoding
Encoding. The character encoding to use if encoding is not determined from file. Default is UTF8.
Exceptions
path is an empty string or defaultEncoding is Nothing.
Remarks
Creates a new TextFieldParser object to parse the file specified by the path parameter.
Caution
When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable and could cause an exception to be thrown.
See also
- OpenTextFieldParser(String)
- Objects (Visual Basic)
- How to: Read From Comma-Delimited Text Files in Visual Basic
- How to: Read From Fixed-width Text Files in Visual Basic
- How to: Read From Text Files with Multiple Formats in Visual Basic
Applies to
TextFieldParser(Stream, Encoding, Boolean)
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
Initializes a new instance of the TextFieldParser class.
public:
TextFieldParser(System::IO::Stream ^ stream, System::Text::Encoding ^ defaultEncoding, bool detectEncoding);
public TextFieldParser(System.IO.Stream stream, System.Text.Encoding defaultEncoding, bool detectEncoding);
new Microsoft.VisualBasic.FileIO.TextFieldParser : System.IO.Stream * System.Text.Encoding * bool -> Microsoft.VisualBasic.FileIO.TextFieldParser
Public Sub New (stream As Stream, defaultEncoding As Encoding, detectEncoding As Boolean)
Parameters
- defaultEncoding
- Encoding
Encoding. The character encoding to use if encoding is not determined from file. Default is UTF8.
- detectEncoding
- Boolean
Boolean. Indicates whether to look for byte order marks at the beginning of the file. Default is True.
Exceptions
stream or defaultEncoding is Nothing.
stream cannot be read from.
Remarks
Creates a new TextFieldParser object to parse the file or stream that is represented by the stream parameter.
If the detectEncoding parameter is True, this constructor attempts to detect the encoding by looking at the first three bytes of the file or stream. It automatically recognizes UTF-8, little-endian Unicode, and big-endian Unicode text if the file starts with the appropriate byte-order marks. Otherwise, the encoding specified by defaultEncoding is used.
Caution
When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable and could cause an exception to be thrown.
See also
- OpenTextFieldParser(String)
- Objects (Visual Basic)
- How to: Read From Comma-Delimited Text Files in Visual Basic
- How to: Read From Fixed-width Text Files in Visual Basic
- How to: Read From Text Files with Multiple Formats in Visual Basic
Applies to
TextFieldParser(String, Encoding, Boolean)
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
Initializes a new instance of the TextFieldParser class.
public:
TextFieldParser(System::String ^ path, System::Text::Encoding ^ defaultEncoding, bool detectEncoding);
public TextFieldParser(string path, System.Text.Encoding defaultEncoding, bool detectEncoding);
new Microsoft.VisualBasic.FileIO.TextFieldParser : string * System.Text.Encoding * bool -> Microsoft.VisualBasic.FileIO.TextFieldParser
Public Sub New (path As String, defaultEncoding As Encoding, detectEncoding As Boolean)
Parameters
- path
- String
String. The complete path of the file to be parsed.
- defaultEncoding
- Encoding
Encoding. The character encoding to use if encoding is not determined from file. Default is UTF8.
- detectEncoding
- Boolean
Boolean. Indicates whether to look for byte order marks at the beginning of the file. Default is True.
Exceptions
path is an empty string or defaultEncoding is Nothing.
Remarks
Creates a new TextFieldParser object to parse the file specified by the path parameter.
If the detectEncoding parameter is True, this constructor attempts to detect the encoding by looking at the first three bytes of the file or stream. It automatically recognizes UTF-8, little-endian Unicode, and big-endian Unicode text if the file starts with the appropriate byte-order marks. Otherwise, the encoding specified by defaultEncoding is used.
Caution
When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable and could cause an exception to be thrown.
See also
- OpenTextFieldParser(String)
- Objects (Visual Basic)
- How to: Read From Comma-Delimited Text Files in Visual Basic
- How to: Read From Fixed-width Text Files in Visual Basic
- How to: Read From Text Files with Multiple Formats in Visual Basic
Applies to
TextFieldParser(Stream, Encoding, Boolean, Boolean)
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
- Source:
- TextFieldParser.vb
Initializes a new instance of the TextFieldParser class.
public:
TextFieldParser(System::IO::Stream ^ stream, System::Text::Encoding ^ defaultEncoding, bool detectEncoding, bool leaveOpen);
public TextFieldParser(System.IO.Stream stream, System.Text.Encoding defaultEncoding, bool detectEncoding, bool leaveOpen);
new Microsoft.VisualBasic.FileIO.TextFieldParser : System.IO.Stream * System.Text.Encoding * bool * bool -> Microsoft.VisualBasic.FileIO.TextFieldParser
Public Sub New (stream As Stream, defaultEncoding As Encoding, detectEncoding As Boolean, leaveOpen As Boolean)
Parameters
- defaultEncoding
- Encoding
Encoding. The character encoding to use if encoding is not determined from file. Default is UTF8.
- detectEncoding
- Boolean
Boolean. Indicates whether to look for byte order marks at the beginning of the file. Default is True.
- leaveOpen
- Boolean
Boolean. Indicates whether to leave stream open when the TextFieldParser object is closed. Default is False.
Exceptions
stream or defaultEncoding is Nothing.
stream cannot be read from.
Remarks
Creates a new TextFieldParser object to parse the file or stream that is represented by the stream parameter.
If the detectEncoding parameter is True, this constructor attempts to detect the encoding by looking at the first three bytes of the file or stream. It automatically recognizes UTF-8, little-endian Unicode, and big-endian Unicode text if the file starts with the appropriate byte-order marks. Otherwise, the encoding specified by defaultEncoding is used.
Caution
When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable and could cause an exception to be thrown.
See also
- OpenTextFieldParser(String)
- Objects (Visual Basic)
- How to: Read From Comma-Delimited Text Files in Visual Basic
- How to: Read From Fixed-width Text Files in Visual Basic
- How to: Read From Text Files with Multiple Formats in Visual Basic