reader class : reader(string,string,bool) fitter


Initializes and returns a new instance of reader class with file name, character encoding, and reading mode setting option.


new reader(string fullPath, string encodingName, bool readOnly)


stringfullPathThe complete file path.
stringencodingNameEncoding name.
boolreadOnlyA value that indicates reading mode.

Return value

readerAn instance that was initialized by specified value.

Sample code


reader r = new reader("c:\somewhere...\sample.txt", "shift_jis", true);


It's a wrapper of the System.IO.StreamReader.StreamReader(String,Encoding,Boolean) constructor. changed in ver

You can specify the encoding with second argument. The encoding will be specified by encoding name.

You can specify detection of the Unicode byte order mark(BOM) with third argument. changed in ver

If true, detects a Unicode byte order mark(BOM). Otherwise, does nothing. changed in ver

You can specify the reading mode with third argument.

If true, open the file in Read Only mode. In this case, no exception occurs even if the file is opened by another process.

If false, an exception will occur if the file is open in another process.

The meaning of the third argument has been changed in Rtype.Reader.dll Ver

Links for reference

Copyright © Cooker All rights reserved.